Metadata-Version: 2.1
Name: gocheck
Version: 0.1.0
Summary: A Python library for barrel distortion correction in wide-angle images
Home-page: https://github.com/jujuspace/gocheck
Author: jujuspace
Author-email: juseongparkai@gmail.com
License: Copyright (c) 2025 jujuspace
         
        Permission is hereby granted, free of charge, to any person obtaining a copy of
        this software and associated documentation files (the "Software"), to deal in
        the Software without restriction, including without limitation the rights to
        use, copy, modify, merge, publish, distribute, sub-license, and/or sell copies
        of the Software, and to permit persons to whom the Software is furnished to do
        so, subject to the following conditions:
         
        The above copyright notice, and every other copyright notice found in this
        software, and all the attributions in every file, and this permission notice
        shall be included in all copies or substantial portions of the Software.
         
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/jujuspace/gocheck
Project-URL: Repository, https://github.com/jujuspace/gocheck
Project-URL: Issues, https://github.com/jujuspace/gocheck/issues
Keywords: image processing,distortion correction,barrel distortion,opencv,computer vision
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Multimedia :: Graphics :: Graphics Conversion
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: opencv-python >=4.5.0
Requires-Dist: numpy >=1.19.0

# GoCheck

A Python library for barrel distortion correction in wide-angle images using field of view (FOV) calculations.

## Features

- **Theoretical Distortion Calculation**: Calculate distortion coefficients (k1, k2) based on field of view
- **Barrel Distortion Correction**: Remove barrel distortion from wide-angle images
- **OpenCV Integration**: Built on top of OpenCV for efficient image processing
- **Simple API**: Easy-to-use functions for quick distortion correction

## Installation

```bash
pip install gocheck
```

## Quick Start

```python
import gocheck

# Correct barrel distortion using field of view
corrected_image = gocheck.undistortion_fov('input_image.jpg', fov=120)

# Calculate theoretical distortion coefficients
k1, k2 = gocheck.theoretical_k1_k2_calculation(fov_degrees=120, image_width=500)
print(f"Distortion coefficients: k1={k1}, k2={k2}")
```

## API Reference

### `undistortion_fov(image_path, fov)`

Corrects barrel distortion in an image based on the field of view.

**Parameters:**
- `image_path` (str): Path to the input image
- `fov` (float): Field of view in degrees

**Returns:**
- `numpy.ndarray`: Corrected image as NumPy array

### `theoretical_k1_k2_calculation(fov_degrees, image_width=500)`

Calculates theoretical distortion coefficients based on field of view.

**Parameters:**
- `fov_degrees` (float): Field of view in degrees
- `image_width` (int, optional): Image width in pixels (default: 500)

**Returns:**
- `tuple`: (k1, k2) distortion coefficients

## Dependencies

- OpenCV (opencv-python >= 4.5.0)
- NumPy (numpy >= 1.19.0)

## Use Cases

- Action camera footage correction
- Wide-angle lens distortion removal
- Drone camera image processing
- Security camera footage enhancement
- VR/AR content preprocessing

## Example

```python
import cv2
import gocheck

# Load and correct an image with 150° FOV
corrected = gocheck.undistortion_fov('wide_angle_photo.jpg', fov=150)

# Save the corrected image
cv2.imwrite('corrected_photo.jpg', corrected)

# Display the result
cv2.imshow('Original vs Corrected', corrected)
cv2.waitKey(0)
cv2.destroyAllWindows()
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## Author

jujuspace
