Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/protonect/include/libfreenect2/registration.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class LIBFREENECT2_API Registration
void apply(int dx, int dy, float dz, float& cx, float &cy) const;

// undistort/register a whole image
void apply(const Frame* rgb, const Frame* depth, Frame* undistorted, Frame* registered, const bool enable_filter = true) const;
void apply(const Frame* rgb, const Frame* depth, Frame* undistorted, Frame* registered, const bool enable_filter = true, Frame* bigdepth = 0) const;

private:
void distort(int mx, int my, float& dx, float& dy) const;
Expand Down
6 changes: 3 additions & 3 deletions examples/protonect/src/registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void Registration::apply( int dx, int dy, float dz, float& cx, float &cy) const
cx = rx * color.fx + color.cx;
}

void Registration::apply(const Frame *rgb, const Frame *depth, Frame *undistorted, Frame *registered, const bool enable_filter) const
void Registration::apply(const Frame *rgb, const Frame *depth, Frame *undistorted, Frame *registered, const bool enable_filter, Frame *bigdepth) const
{
// Check if all frames are valid and have the correct size
if (!rgb || !depth || !undistorted || !registered ||
Expand Down Expand Up @@ -123,7 +123,7 @@ void Registration::apply(const Frame *rgb, const Frame *depth, Frame *undistorte

// initializing the depth_map with values outside of the Kinect2 range
if(enable_filter){
filter_map = new float[size_filter_map];
filter_map = bigdepth ? (float*)bigdepth->data : new float[size_filter_map];
p_filter_map = filter_map + offset_filter_map;

for(float *it = filter_map, *end = filter_map + size_filter_map; it != end; ++it){
Expand Down Expand Up @@ -210,7 +210,7 @@ void Registration::apply(const Frame *rgb, const Frame *depth, Frame *undistorte
*registered_data = (z - min_z) / z > filter_tolerance ? 0 : *(rgb_data + c_off);
}

delete[] filter_map;
if (!bigdepth) delete[] filter_map;
}
else
{
Expand Down