Metadata-Version: 2.4
Name: deltacamera
Version: 0.5.2.dev0
Summary: Manipulate camera calibration parameters and warp images for computer vision tasks.
Author-email: István Sárándi <istvan.sarandi@uni-tuebingen.de>
License: MIT License
        
        Copyright (c) 2023 István Sárándi
        
        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, sublicense, 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 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 NONINFRINGEMENT. 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/isarandi/deltacamera
Project-URL: Repository, https://github.com/isarandi/deltacamera
Project-URL: Documentation, https://deltacamera.readthedocs.io/
Project-URL: Issues, https://github.com/isarandi/deltacamera/issues
Project-URL: Changelog, https://github.com/isarandi/deltacamera/releases
Project-URL: Author, https://istvansarandi.com
Keywords: camera,calibration,computer-vision,image-warping,distortion,lens-distortion,reprojection
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development :: Libraries
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: opencv-python
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: numba
Requires-Dist: shapely
Requires-Dist: msgpack-numpy
Requires-Dist: boxlib
Requires-Dist: rlemasklib
Provides-Extra: test
Requires-Dist: pytest>=7.0; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: scikit-image; extra == "test"
Provides-Extra: lint
Requires-Dist: ruff; extra == "lint"
Requires-Dist: pre-commit; extra == "lint"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: pydata-sphinx-theme; extra == "docs"
Requires-Dist: sphinx-autoapi; extra == "docs"
Requires-Dist: sphinxcontrib-bibtex; extra == "docs"
Requires-Dist: sphinx-markdown-builder; extra == "docs"
Requires-Dist: setuptools-scm; extra == "docs"
Requires-Dist: toml; extra == "docs"
Provides-Extra: gui
Requires-Dist: PyQt6>=6.5.0; extra == "gui"
Provides-Extra: dev
Requires-Dist: deltacamera[docs,lint,test]; extra == "dev"
Dynamic: license-file

# Deltacamera

Represent, manipulate and use camera calibration info in computer vision tasks.

Main features:

- The library supports **converting coordinates** between world, camera and image space, handing **lens distortion** models according to the Brown–Conrady and Kannala–Brandt models.
- Modify cameras with intuitive methods such as `camera.zoom`, `camera.rotate`, `camera.scale_output`, `camera.turn_towards`, etc.
- Conversion between distorted and undistorted image spaces are also implemented in an efficient way using Numba and **a more accurate inversion of Brown–Conrady distortion** compared to OpenCV. We use Newton's method in addition to the standard fixed-point iteration. This library can also keep track of valid image regions after warping, inspired by [Leotta et al.](https://openaccess.thecvf.com/content/WACV2022/papers/Leotta_On_the_Maximum_Radius_of_Polynomial_Lens_Distortion_WACV_2022_paper.pdf), but extended to the full Brown-Conrady and Kannala-Brandt models.

- This library also includes efficient implementations of **image warping**, with antialiasing support and interpolation in linear RGB color space. The warping maps can be cached for very fast repeated use (e.g., warp/undistort a video taken from a static camera to another calibration setup). This also supports partial caching of only the more expensive distortion part. This is useful when the rotation can change during a video, but the distortion parameters are fixed (e.g., turning the camera to keep the subject centered).

## Installation

```bash
pip install deltacamera
```

It is recommended to then run the Numba precompilation step (takes around 1–2 minutes). This will make image warping and coordinate transformations fast already on first use.

```bash
python -m deltacamera.precompile
```

## Documentation

Full documentation is available at [deltacamera.readthedocs.io](https://deltacamera.readthedocs.io).

## References

For the idea of computing the valid image region after distortion, see:
- Matthew J. Leotta, David Russell, Andrew Matrai, "On the Maximum Radius of Polynomial Lens Distortion", WACV 2022.
