Skip to content

Commit 969a70f

Browse files
committed
converted rgb to float, to suit PointXYZRGB pcl structure
1 parent 607f2af commit 969a70f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/protonect/include/libfreenect2/registration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class LIBFREENECT2_API Registration
5050
void apply(const Frame* rgb, const Frame* depth, Frame* undistorted, Frame* registered, const bool enable_filter = true, Frame* bigdepth = 0) const;
5151

5252
// compute point XYZ RGB from undistored and registered frames
53-
void getPointXYZRGB (const Frame* undistorted, const Frame* registered, int r, int c, float& x, float& y, float& z, unsigned int& rgb) const;
53+
void getPointXYZRGB (const Frame* undistorted, const Frame* registered, int r, int c, float& x, float& y, float& z, float& rgb) const;
5454

5555
private:
5656
void distort(int mx, int my, float& dx, float& dy) const;

examples/protonect/src/registration.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ void Registration::apply(const Frame *rgb, const Frame *depth, Frame *undistorte
262262
* @param[out] z z coordinate of point.
263263
* @param[out] RGB associated rgb color of point.
264264
*/
265-
void Registration::getPointXYZRGB (const Frame* undistorted, const Frame* registered, int r, int c, float& x, float& y, float& z, unsigned int& rgb) const
265+
void Registration::getPointXYZRGB (const Frame* undistorted, const Frame* registered, int r, int c, float& x, float& y, float& z, float& rgb) const
266266
{
267267
const float bad_point = std::numeric_limits<float>::quiet_NaN();
268268
const float cx(depth.cx), cy(depth.cy);
@@ -282,7 +282,7 @@ void Registration::getPointXYZRGB (const Frame* undistorted, const Frame* regist
282282
x = (c + 0.5 - cx) * fx * depth_val;
283283
y = (r + 0.5 - cy) * fy * depth_val;
284284
z = depth_val;
285-
rgb = registered_data[512*r+c];
285+
rgb = *reinterpret_cast<float*>(&registered_data[512*r+c]);
286286
return;
287287
}
288288
}

0 commit comments

Comments
 (0)