Skip to main content

Manipulate camera calibration parameters and warp images for computer vision tasks.

Project description

DeltaCamera

This library is about camera models, coordinate transformations, and image warping/undistortion to account for changing camera parameters and lens distortion.

Main use cases

  • Convert coordinates between world, camera and image space, handing lens distortion models according to the 14-parameter extended Brown–Conrady and the 4-parameter Kannala–Brandt fisheye models.
  • Reproject image points and entire images between different camera calibration settings (e.g., rotate the camera or change lens distortion).
  • Modify cameras with intuitive methods such as camera.zoomed, camera.rotated, camera.image_resized, camera.turned_towards, etc.

Benefits

  • Speed: The critical functions are accelerated with Numba and intermediate computations are cached for high performance.
  • Accuracy: We use a more accurate inversion of Brown–Conrady compared to OpenCV. OpenCV uses only fixed-point iteration, we use Newton's method in addition to that.
  • Tracking of pixel validity: When warping images, we keep track of which pixels in the output image are valid (i.e., map to valid pixels in the input image), taking into account also the valid region of the lens distortion model (outside of which distortion folds back on itself, and would cause artifacts if not detected). The valid region can be obtained as a Shapely polygon, an RLEMaskLib mask or as NaNs in the return values. This feature is missing from OpenCV.
  • Linear color interpolation: When warping images, we use linear interpolation in linear color space (gamma corrected), which avoids artifacts when warping images with strong contrast.
  • Anti-aliasing: When warping images, we use supersampling to avoid aliasing artifacts when downsampling parts of the image.

Installation

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.

python -m deltacamera.precompile

Documentation

Full documentation is available at 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deltacamera-0.5.3.dev0.tar.gz (106.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deltacamera-0.5.3.dev0-py3-none-any.whl (55.9 kB view details)

Uploaded Python 3

File details

Details for the file deltacamera-0.5.3.dev0.tar.gz.

File metadata

  • Download URL: deltacamera-0.5.3.dev0.tar.gz
  • Upload date:
  • Size: 106.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for deltacamera-0.5.3.dev0.tar.gz
Algorithm Hash digest
SHA256 6bc773216c3d4e4f033324c6afefccb0bd9bd681c8bce6e76378a8cfda3c766f
MD5 929aee036a48fb5c54fe5efd4355da26
BLAKE2b-256 9330b518d627b0cf5ccf816fc91a7b36198661769dc199676c88bf18c01078e1

See more details on using hashes here.

File details

Details for the file deltacamera-0.5.3.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for deltacamera-0.5.3.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e52fa4db896ac65c7b392bd007d873a2b4b666c387713e2f2ac399f63114809
MD5 25db592564c9a9ae46db521a952e08b4
BLAKE2b-256 d4ca9fb7abc99a18b34b7447fb05618f3f0c0fcdb59822d6f53aa8c76cdfc4ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page