deltacamera#

Deltacamera: Camera calibration manipulation and image warping for computer vision.

This library provides coordinate transformations between world, camera, and image spaces with support for Brown-Conrady and Kannala-Brandt (fisheye) lens distortion models.

Example

>>> from deltacamera import Camera
>>> cam = Camera(intrinsic_matrix=[[500, 0, 320], [0, 500, 240], [0, 0, 1]])
>>> cam.world_to_image([[1, 2, 3]])

Submodules#

Classes#

Camera

Pinhole camera with extrinsic and intrinsic calibration with optional distortions.

BrownConradyEx

Brown-Conrady distortion model.

FisheyeKannalaBrandt

Kannala-Brandt fisheye distortion model.

LensDistortionModel

Base class for lens distortion models.

Functions#

intrinsics_from_fov(fov_degrees, imshape[, side])

Create an intrinsic matrix from a field of view and image shape.

transform_points(points, old_camera, new_camera)

Transform 3D points from one camera's coordinate frame to another's.

visible_subbox(old_camera, new_camera, old_imshape, ...)

Compute the sub-box of new_box that would contain valid pixels when reprojecting.

estimate_fov_from_vanishing_points(vp1, vp2, imshape)

Estimate camera FOV from two orthogonal vanishing points.

decode_srgb(im[, dst])

Decodes an 8-bit sRGB image to linear 16-bit.

encode_srgb(im[, dst])

Encodes a linear 16-bit image to 8-bit sRGB.

reproject_box(old_box, old_camera, new_camera)

Reprojects a bounding box from one camera to another.

reproject_box_corners(old_box, old_camera, new_camera)

Reprojects a bounding box from one camera to another using its corners.

reproject_box_inscribed_ellipse(old_box, old_camera, ...)

Reprojects a bounding box from one camera to another using its inscribed ellipse.

reproject_box_side_midpoints(old_box, old_camera, ...)

Reprojects a bounding box from one camera to another using its side midpoints.

reproject_depth_map(depth_map, old_camera, new_camera)

Reproject a depth map from old_camera to new_camera.

reproject_image(image, old_camera, new_camera[, ...])

Transform an image captured with old_camera to look like it was captured by

reproject_image_fast(image, old_camera, new_camera[, ...])

Like reproject_image, but assumes there are no lens distortions.

reproject_rgbd(image, depth_map, old_camera, new_camera)

Reproject an RGB image and depth map together, sharing intermediate computation.

reproject_image_points(points, old_camera, new_camera)

Reproject 2D image points from old_camera to new_camera.

reproject_mask(mask, old_camera, new_camera, dst_shape)

Reproject a binary mask from one camera view to another.

reproject_rle_mask(rle_mask, old_camera, new_camera, ...)

Reproject an RLE-encoded mask from one camera view to another.

get_valid_mask(camera[, imshape])

Get the valid region mask for a camera with lens distortion.

get_valid_mask_reproj(old_camera, new_camera[, ...])

Get the valid region mask when reprojecting between two cameras.