Skip to content

Releases: isarandi/deltacamera

v0.7.0

21 Mar 11:17

Choose a tag to compare

What's New

deltacamera.pt: PyTorch Camera Operations

New deltacamera.pt subpackage providing the full camera model and image reprojection pipeline in PyTorch, supporting both CPU and GPU.

  • pt.Camera class mirroring the numpy Camera API (coordinate transforms, camera manipulation, distortion handling)
  • pt.reproject_image / pt.reproject_image_multi for batched image warping
  • pt.reproject_image_points and pt.reproject_depth_map
  • Smart batching: detects shared distortion across batch elements and computes the expensive undistortion step only once
  • Single-image auto-expand for multi-crop workflows (1 image, N target cameras)
  • Differentiable: gradients flow through the full reprojection pipeline
  • Edge-preserving depth downsampling via nanmedian (matching numpy behavior)
  • Install with pip install deltacamera[pt]

Documentation

  • Sphinx docs overhauled: GitHub source links, clickable code examples, method categorization, custom theming
  • Clean API type paths (e.g. deltacamera.LensDistortionModel instead of deltacamera.distortion_models.LensDistortionModel)

Fixes

  • Deprecation warning for output_imshape now correctly suggests Camera.copy(image_shape=...) instead of the non-settable property
  • Simplified projection division in coordframes
  • RTD build uses pyproject.toml extras instead of requirements.txt

v0.6.3

11 Feb 23:24

Choose a tag to compare

New Features

Depth map reprojection — New reproject_depth_map function that correctly handles per-pixel z-correction when the camera rotates, with NaN-safe nanmedian antialiasing and bilateral filtering for clean downsampling. New reproject_rgbd for combined image+depth reprojection that shares intermediate computation (remap maps, homographies, validity masks).

Camera-to-camera point transform — New transform_points(points, old_camera, new_camera) for direct 3D point transformation between camera coordinate frames, backed by a Numba-accelerated camera_to_camera function.

turned_towards accepts image/camera pointsturned_towards now takes target_image_point, target_world_point, or target_cam_point as keyword arguments instead of requiring world coordinates.

point_shifted_to_center — New convenience method to shift the principal point so that a given image point appears at the image center.

image_scaled improvements — No longer requires image_shape to be set. New center_subpixels parameter for correct supersampling alignment.

undistorted gains zero_skew — Option to zero the skew coefficient when removing distortion.

copy() supports clearing fieldscopy(distortion_model=None) and copy(image_shape=None) now work to clear these fields (previously None meant "don't change").

API Changes

  • BrownConrady renamed to BrownConradyEx
  • undistort_precise renamed to undistorted_with_optimal_intrinsics (now immutable)
  • is_allclose / is_equal now also compare world_up and image_shape
  • distortion_coeffs setter added (deprecated, prefer copy(distortion_model=...))
  • Requires rlemasklib >= 0.7.0

Bug Fixes

  • Remap direction for undistorted cameras: make() in maps_impl had old/new cameras swapped for the NONE+NONE case, producing the forward homography instead of the inverse remap
  • Cached rotation order: get_maps_and_mask_cached used R_old^T @ R_new instead of R_new @ R_old^T
  • get_fov axis order: height was matched with fx instead of fy
  • Skew in horizontal flip: hflip_image and image_hflipped now correctly negate K[0,1]
  • Backprojection with skew: backproject_K_depthval was missing division by K[1,1] for the skew term
  • Validity bounds: world_to_image now uses strict upper bound (pixels at exactly width/height are out of bounds)
  • Degenerate turn_towards: handles the case when looking along world_up by falling back to an arbitrary perpendicular frame
  • get_distortion_coeffs truncation: no longer truncates when n_coeffs_max is None
  • Empty polygon handling: clean_up_polygon returns empty Polygon() instead of None; visible_subbox handles empty polygons gracefully
  • Fixed PyPI versioning: _version.py was tracked in git with a stale version, causing all releases to get .dev0 suffixes

Refactors

  • Use _distortion_model.coeffs directly instead of deprecated distortion_coeffs property in internal code
  • Replace mask_image_by_rle with rlemasklib's decode_into
  • Check affine path before perspective in reproject_image_aliased
  • Use ValueError instead of bare Exception for optical center mismatch

Documentation

  • New explanation document on how distortion interacts with in-image rotation
  • Wording improvements in distortion-validity and reprojection docs
  • Added BibTeX references (Brown, Weng, Claus, Kannala)

v0.5.3

09 Feb 22:01

Choose a tag to compare

New Features

Immutable Camera API — New methods that return modified copies instead of mutating in place, using past-participle naming:

  • zoomed, rotated, turned_towards, orbited_around, rolled_upright, hflipped
  • image_shifted, point_shifted_to, image_cropped, image_padded, image_resized, image_scaled
  • image_hflipped, image_rotated, image_rot90
  • undistorted, principal_point_centered

Direct mutation of Camera arrays (intrinsic_matrix, R, t, world_up) now emits DeprecationWarning.

Distortion model classes — New LensDistortionModel base class with BrownConrady and FisheyeKannalaBrandt subclasses (frozen dataclasses, immutable and hashable). Replaces the raw coefficient array with typed, validated objects. Factory function infer_distortion_model(coeffs) for automatic detection.

14-parameter distortion with tilt — Full support for OpenCV-compatible 14-parameter extended Brown–Conrady distortion (including tilt parameters tau_x, tau_y) in distortion, undistortion, Jacobian computation, and validity boundary detection.

Camera.image_shape — Cameras can now store their image shape (image_shape or image_size constructor parameter). Several methods (undistorted, image_resized, image_hflipped, image_rot90) require it.

Camera is now hashable__hash__ and __eq__ based on all parameters.

Image transform with distortion coefficient correctionimage_hflipped, image_rotated, and image_rot90 correctly transform Brown–Conrady coefficients (including 14-param tilt) and handle fisheye models, so distortion coefficients remain valid after geometric image transforms.

API Changes

  • Camera.copy() now accepts keyword arguments to create a modified copy (intrinsic_matrix, rot_world_to_cam, optical_center, distortion_model, world_up, image_shape, etc.)
  • distortion_coeffs constructor parameter deprecated in favor of distortion_model
  • output_imshape parameter on reproject_image etc. deprecated; use camera.image_shape instead
  • imshape parameter on get_valid_poly, get_valid_mask deprecated; use camera.image_shape instead

Bug Fixes

  • Fixed tilt matrix convention in _distort_points, _distort_points_with_jacobian, and _undistort_points to match OpenCV's matTilt = matProjZ @ matRotXY
  • Fixed sign bug in tilt Jacobian terms in _jacobian_det_polar_impl and _jacobian_det_and_prime_polar_impl
  • Fixed horizontal_flip_image not negating tau_y for 14-param distortion

Documentation

  • New landing page with feature overview and quick start
  • New explanation document on SymPy code generation for analytical Jacobians
  • Fixed color space terminology in README

Testing

  • New test modules: test_autodiff_validation, test_coverage_gaps, test_rotate_image, test_rotate_image_14param, test_vanishing_point
  • Extended test_camera with image transform tests, test_distortion with OpenCV comparison tests
  • Test calibration data from DNA-Rendering, EgoHumans, and JRDB datasets

v0.4.0

12 Jan 04:27

Choose a tag to compare

Renamed to deltacamera