![]() |
ImFusion SDK 4.3
|
#include <RGBD/Include/ImFusion/RGBD/DepthColorWarping.h>
DepthColorWarping provides functionality for warping between depth and color images using camera calibration and extrinsic parameters. More...
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.
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< SharedImageSet > | warpedColor (bool interpolate=false) |
| Returns a warped color image set aligned to the depth image. | |
| std::unique_ptr< SharedImageSet > | warpedDepth () |
| Returns a warped depth image set aligned to the color image. | |
| std::unique_ptr< SharedImageSet > | depthToColorMap () |
| 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. | |
| 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.
| project | Function taking color intrinsics and a 3D point, returning 2D pixel coordinates. |
This is useful for advanced camera models or custom calibration.
| 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.
| unproject | Function 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.
| std::unique_ptr< SharedImageSet > warpedColor | ( | bool | interpolate = false | ) |
Returns a warped color image set aligned to the depth image.
| interpolate | If true, uses interpolation for smoother results. |
| std::unique_ptr< SharedImageSet > warpedDepth | ( | ) |
Returns a warped depth image set aligned to the color image.
| std::unique_ptr< SharedImageSet > depthToColorMap | ( | ) |
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.
| depthToColorMap | Pointer to TypedImage<float> with depth image dimensions. |
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.