MCPcopy Create free account
hub / github.com/OpenKinect/libfreenect2 / depth_to_color

Method depth_to_color

src/registration.cpp:87–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87void RegistrationImpl::depth_to_color(float mx, float my, float& rx, float& ry) const
88{
89 mx = (mx - depth.cx) * depth_q;
90 my = (my - depth.cy) * depth_q;
91
92 float wx =
93 (mx * mx * mx * color.mx_x3y0) + (my * my * my * color.mx_x0y3) +
94 (mx * mx * my * color.mx_x2y1) + (my * my * mx * color.mx_x1y2) +
95 (mx * mx * color.mx_x2y0) + (my * my * color.mx_x0y2) + (mx * my * color.mx_x1y1) +
96 (mx * color.mx_x1y0) + (my * color.mx_x0y1) + (color.mx_x0y0);
97
98 float wy =
99 (mx * mx * mx * color.my_x3y0) + (my * my * my * color.my_x0y3) +
100 (mx * mx * my * color.my_x2y1) + (my * my * mx * color.my_x1y2) +
101 (mx * mx * color.my_x2y0) + (my * my * color.my_x0y2) + (mx * my * color.my_x1y1) +
102 (mx * color.my_x1y0) + (my * color.my_x0y1) + (color.my_x0y0);
103
104 rx = (wx / (color.fx * color_q)) - (color.shift_m / color.shift_d);
105 ry = (wy / color_q) + color.cy;
106}
107
108void Registration::apply( int dx, int dy, float dz, float& cx, float &cy) const
109{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected