ImFusion SDK 4.3
DepthColorWarping Class Reference

#include <RGBD/Include/ImFusion/RGBD/DepthColorWarping.h>

DepthColorWarping provides functionality for warping between depth and color images using camera calibration and extrinsic parameters. More...

Detailed Description

DepthColorWarping provides functionality for warping between depth and color images using camera calibration and extrinsic parameters.

This class is intended for use in RGB-D sensor fusion, mesh texturing, and frame alignment tasks.

DepthColorWarping supports both forward (depth-to-color) and inverse (color-to-depth) warping, and allows custom projection/unprojection functions for advanced camera models.

Typical usage involves constructing the class with depth and color images (and optionally calibration data), then calling warpedColor(), warpedDepth(), or depthToColorMap() to obtain the warped results.

ImFusion::DepthColorWarping warping(depthImage, colorImage, rgbdComponent);
auto warpedColorSet = warping.warpedColor(true); // interpolated
auto warpedDepthSet = warping.warpedDepth();
auto depthToColor = warping.depthToColorMap();
DepthColorWarping provides functionality for warping between depth and color images using camera cali...
Definition DepthColorWarping.h:41
Note
  • All image coordinates are in pixel units; 3D points are in camera coordinate system.
  • The input images must be compatible in terms of calibration and resolution.
  • Ownership of returned SharedImageSet pointers is transferred to the caller.
See also
ImFusion::SharedImageSet, ImFusion::RGBDDataComponent All methods are not thread-safe unless otherwise stated.

Public Member Functions

 DepthColorWarping (MemImage *depth, MemImage *color, const RGBDDataComponent *comp=nullptr)
 
 DepthColorWarping (const SharedImageSet *depth, const SharedImageSet *color)
 
void setProjectColorFunction (std::function< vec2(const mat3 &, const vec3 &)> project)
 Sets a custom projection function for mapping 3D points in the color camera coordinate system to pixel coordinates.
 
void setUnprojectDepthFunction (std::function< vec3(const mat3 &, double, const vec2 &)> unproject)
 Sets a custom unprojection function for mapping pixel coordinates in the depth image to 3D points in the depth camera coordinate system.
 
std::unique_ptr< SharedImageSetwarpedColor (bool interpolate=false)
 Returns a warped color image set aligned to the depth image.
 
std::unique_ptr< SharedImageSetwarpedDepth ()
 Returns a warped depth image set aligned to the color image.
 
std::unique_ptr< SharedImageSetdepthToColorMap ()
 Returns a depth-to-color map as a clone of the internally computed map.
 
bool depthToColorMap (TypedImage< float > *depthToColorMap) const
 Copies the depth-to-color map to the provided image.
 

Member Function Documentation

◆ setProjectColorFunction()

void setProjectColorFunction ( std::function< vec2(const mat3 &, const vec3 &)> project)

Sets a custom projection function for mapping 3D points in the color camera coordinate system to pixel coordinates.

Parameters
projectFunction taking color intrinsics and a 3D point, returning 2D pixel coordinates.

This is useful for advanced camera models or custom calibration.

◆ setUnprojectDepthFunction()

void setUnprojectDepthFunction ( std::function< vec3(const mat3 &, double, const vec2 &)> unproject)

Sets a custom unprojection function for mapping pixel coordinates in the depth image to 3D points in the depth camera coordinate system.

Parameters
unprojectFunction taking inverse depth intrinsics, distance to xy-plane, and pixel coordinates, returning a 3D point.

This is useful for advanced camera models or custom calibration.

◆ warpedColor()

std::unique_ptr< SharedImageSet > warpedColor ( bool interpolate = false)

Returns a warped color image set aligned to the depth image.

Parameters
interpolateIf true, uses interpolation for smoother results.
Returns
Unique pointer to SharedImageSet containing the warped color image(s). Ownership is transferred to the caller.

◆ warpedDepth()

std::unique_ptr< SharedImageSet > warpedDepth ( )

Returns a warped depth image set aligned to the color image.

Returns
Unique pointer to SharedImageSet containing the warped depth image(s). Ownership is transferred to the caller.

◆ depthToColorMap() [1/2]

std::unique_ptr< SharedImageSet > depthToColorMap ( )

Returns a depth-to-color map as a clone of the internally computed map.

Returns
Unique pointer to SharedImageSet containing the depth-to-color map. Ownership is transferred to the caller.

◆ depthToColorMap() [2/2]

bool depthToColorMap ( TypedImage< float > * depthToColorMap) const

Copies the depth-to-color map to the provided image.

Parameters
depthToColorMapPointer to TypedImage<float> with depth image dimensions.
Returns
true if successful, false otherwise.

This method is faster than depthToColorMap(), but does not store the map internally. Use only for one-time use; caller retains ownership of the image.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close