libfreenect2
0.2
|
Combine frames of depth and color camera. More...
#include <libfreenect2/registration.h>
Public Member Functions | |
Registration (Freenect2Device::IrCameraParams depth_p, Freenect2Device::ColorCameraParams rgb_p) | |
~Registration () | |
void | apply (int dx, int dy, float dz, float &cx, float &cy) const |
Undistort and register a single depth point to color camera. More... | |
void | apply (const Frame *rgb, const Frame *depth, Frame *undistorted, Frame *registered, const bool enable_filter=true, Frame *bigdepth=0, int *color_depth_map=0) const |
Map color images onto depth images. More... | |
void | undistortDepth (const Frame *depth, Frame *undistorted) const |
Undistort depth. More... | |
void | getPointXYZRGB (const Frame *undistorted, const Frame *registered, int r, int c, float &x, float &y, float &z, float &rgb) const |
Construct a 3-D point with color in a point cloud. More... | |
void | getPointXYZ (const Frame *undistorted, int r, int c, float &x, float &y, float &z) const |
Construct a 3-D point in a point cloud. More... | |
Combine frames of depth and color camera.
Right now this class uses a reverse engineered formula that uses factory preset extrinsic parameters. We do not have a clear understanding of these particular extrinsic parameters and do not know how to calibrate them by hand.
If you want to perform registration with standard camera extrinsic matrix, you probably need something else.
Registration | ( | Freenect2Device::IrCameraParams | depth_p, |
Freenect2Device::ColorCameraParams | rgb_p | ||
) |
depth_p | Depth camera parameters. You can use the factory values, or use your own. |
rgb_p | Color camera parameters. Probably use the factory values for now. |
~Registration | ( | ) |
void apply | ( | int | dx, |
int | dy, | ||
float | dz, | ||
float & | cx, | ||
float & | cy | ||
) | const |
Undistort and register a single depth point to color camera.
dx | Distorted depth coordinate x (pixel) | |
dy | Distorted depth coordinate y (pixel) | |
dz | Depth value (millimeter) | |
[out] | cx | Undistorted color coordinate x (normalized) |
[out] | cy | Undistorted color coordinate y (normalized) |
void apply | ( | const Frame * | rgb, |
const Frame * | depth, | ||
Frame * | undistorted, | ||
Frame * | registered, | ||
const bool | enable_filter = true , |
||
Frame * | bigdepth = 0 , |
||
int * | color_depth_map = 0 |
||
) | const |
Map color images onto depth images.
rgb | Color image (1920x1080 BGRX) | |
depth | Depth image (512x424 float) | |
[out] | undistorted | Undistorted depth image |
[out] | registered | Color image for the depth image (512x424) |
enable_filter | Filter out pixels not visible to both cameras. | |
[out] | bigdepth | If not NULL , return mapping of depth onto colors (1920x1082 float). 1082 not 1080, with a blank top and bottom row. |
[out] | color_depth_map | Index of mapped color pixel for each depth pixel (512x424). |
Undistort depth.
depth | Depth image (512x424 float) | |
[out] | undistorted | Undistorted depth image |
void getPointXYZRGB | ( | const Frame * | undistorted, |
const Frame * | registered, | ||
int | r, | ||
int | c, | ||
float & | x, | ||
float & | y, | ||
float & | z, | ||
float & | rgb | ||
) | const |
Construct a 3-D point with color in a point cloud.
undistorted | Undistorted depth frame from apply(). | |
registered | Registered color frame from apply(). | |
r | Row (y) index in depth image. | |
c | Column (x) index in depth image. | |
[out] | x | X coordinate of the 3-D point (meter). |
[out] | y | Y coordinate of the 3-D point (meter). |
[out] | z | Z coordinate of the 3-D point (meter). |
[out] | rgb | Color of the 3-D point (BGRX). To unpack the data, use const uint8_t *p = reinterpret_cast<uint8_t*>(&rgb); uint8_t b = p[0]; uint8_t g = p[1]; uint8_t r = p[2]; |
void getPointXYZ | ( | const Frame * | undistorted, |
int | r, | ||
int | c, | ||
float & | x, | ||
float & | y, | ||
float & | z | ||
) | const |
Construct a 3-D point in a point cloud.
undistorted | Undistorted depth frame from apply(). | |
r | Row (y) index in depth image. | |
c | Column (x) index in depth image. | |
[out] | x | X coordinate of the 3-D point (meter). |
[out] | y | Y coordinate of the 3-D point (meter). |
[out] | z | Z coordinate of the 3-D point (meter). |