reproject_rgbd#
- deltacamera.reproject_rgbd(image, depth_map, old_camera, new_camera, output_imshape=None, border_mode=cv2.BORDER_CONSTANT, border_value=0, image_interp=None, depth_interp=cv2.INTER_NEAREST, antialias_factor=1, dst=None, cache_maps=False, precomp_undist_maps=True, use_linear_srgb=False, return_validity_mask=False)[source]#
Reproject an RGB image and depth map together, sharing intermediate computation.
This is equivalent to calling
reproject_imageandreproject_depth_mapseparately, but avoids redundant computation of remap maps, homographies, and validity masks.When
antialias_factor> 1, both are rendered at higher resolution and then block-downsampled: the image via area averaging, the depth via nanmedian (NaN-safe).- Parameters:
image (ndarray) – RGB image, shape (H, W, 3).
depth_map (ndarray) – Depth map, shape (H, W), float. NaN or 0 marks invalid pixels.
old_camera (Camera) – The camera that captured the image and depth.
new_camera (Camera) – The target camera.
output_imshape (tuple) – (height, width) for the output. If None, uses new_camera.image_shape.
border_mode (int) – OpenCV border mode for treating pixels outside the image.
border_value – Border value for image pixels outside the input.
image_interp – OpenCV interpolation for the image. Default: cv2.INTER_LINEAR.
depth_interp (int) – OpenCV interpolation for the depth. Default: cv2.INTER_NEAREST.
antialias_factor (int) – Supersample factor. Both image and depth are rendered at this multiple of the output resolution, then downsampled (image: area average, depth: nanmedian).
dst – Destination array for the image (optional).
cache_maps (bool) – Whether to cache coordinate maps for repeated use.
precomp_undist_maps (bool) – Whether to precompute and cache undistortion maps.
use_linear_srgb (bool) – If True, decode image from 8-bit sRGB to 16-bit linear space before reprojecting and encode back afterward.
return_validity_mask (bool) – If True, return (new_image, new_depth, validity_mask).
- Returns:
(new_image, new_depth) or (new_image, new_depth, validity_mask).
- Return type: