Skip to content

Commit

Permalink
clear rgb pixels without depth data for map_rgb_to_depth
Browse files Browse the repository at this point in the history
  • Loading branch information
floe authored and fran6co committed Jun 9, 2014
1 parent a55cd43 commit be35d02
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/registration.c
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

0 comments on commit be35d02

Please sign in to comment.