Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
clear rgb pixels without depth data for map_rgb_to_depth
  • Loading branch information
floe committed Mar 30, 2012
commit fb9ee88d3574a9c835a602811b124bdbbe582579
12 changes: 10 additions & 2 deletions src/registration.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,17 @@ void freenect_map_rgb_to_depth(freenect_device* dev, uint16_t* depth_mm, uint8_t
uint32_t cx,cy,cindex;

int wz = depth_mm[index];
//if (wz == 0) continue;

// coordinates in rgb image corresponding to x,y
// pixels without depth data are black
if (wz == 0) {
index = index*3;
rgb_registered[index+0] = 0;
rgb_registered[index+1] = 0;
rgb_registered[index+2] = 0;
continue;
}

// coordinates in rgb image corresponding to x,y in depth image
cx = (dev->registration.registration_table[index][0] + dev->registration.depth_to_rgb_shift[wz]) / REG_X_VAL_SCALE;
cy = dev->registration.registration_table[index][1];

Expand Down