Releases: isarandi/deltacamera
v0.7.0
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.Cameraclass mirroring the numpy Camera API (coordinate transforms, camera manipulation, distortion handling)pt.reproject_image/pt.reproject_image_multifor batched image warpingpt.reproject_image_pointsandpt.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.LensDistortionModelinstead ofdeltacamera.distortion_models.LensDistortionModel)
Fixes
- Deprecation warning for
output_imshapenow correctly suggestsCamera.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
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 points — turned_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 fields — copy(distortion_model=None) and copy(image_shape=None) now work to clear these fields (previously None meant "don't change").
API Changes
BrownConradyrenamed toBrownConradyExundistort_preciserenamed toundistorted_with_optimal_intrinsics(now immutable)is_allclose/is_equalnow also compareworld_upandimage_shapedistortion_coeffssetter added (deprecated, prefercopy(distortion_model=...))- Requires
rlemasklib >= 0.7.0
Bug Fixes
- Remap direction for undistorted cameras:
make()inmaps_implhad 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_cachedusedR_old^T @ R_newinstead ofR_new @ R_old^T get_fovaxis order: height was matched with fx instead of fy- Skew in horizontal flip:
hflip_imageandimage_hflippednow correctly negateK[0,1] - Backprojection with skew:
backproject_K_depthvalwas missing division byK[1,1]for the skew term - Validity bounds:
world_to_imagenow uses strict upper bound (pixels at exactly width/height are out of bounds) - Degenerate
turn_towards: handles the case when looking alongworld_upby falling back to an arbitrary perpendicular frame get_distortion_coeffstruncation: no longer truncates whenn_coeffs_maxis None- Empty polygon handling:
clean_up_polygonreturns emptyPolygon()instead ofNone;visible_subboxhandles empty polygons gracefully - Fixed PyPI versioning:
_version.pywas tracked in git with a stale version, causing all releases to get.dev0suffixes
Refactors
- Use
_distortion_model.coeffsdirectly instead of deprecateddistortion_coeffsproperty in internal code - Replace
mask_image_by_rlewithrlemasklib'sdecode_into - Check affine path before perspective in
reproject_image_aliased - Use
ValueErrorinstead of bareExceptionfor 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
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,hflippedimage_shifted,point_shifted_to,image_cropped,image_padded,image_resized,image_scaledimage_hflipped,image_rotated,image_rot90undistorted,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 correction — image_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_coeffsconstructor parameter deprecated in favor ofdistortion_modeloutput_imshapeparameter onreproject_imageetc. deprecated; usecamera.image_shapeinsteadimshapeparameter onget_valid_poly,get_valid_maskdeprecated; usecamera.image_shapeinstead
Bug Fixes
- Fixed tilt matrix convention in
_distort_points,_distort_points_with_jacobian, and_undistort_pointsto match OpenCV'smatTilt = matProjZ @ matRotXY - Fixed sign bug in tilt Jacobian terms in
_jacobian_det_polar_impland_jacobian_det_and_prime_polar_impl - Fixed
horizontal_flip_imagenot 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_camerawith image transform tests,test_distortionwith OpenCV comparison tests - Test calibration data from DNA-Rendering, EgoHumans, and JRDB datasets