Skip to content
Merged
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
6 changes: 3 additions & 3 deletions examples/protonect/src/registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ Registration::Registration(Freenect2Device::IrCameraParams depth_p, Freenect2Dev
// compute the dirstored coordinate for current pixel
distort(x,y,mx,my);
// rounding the values and check if the pixel is inside the image
ix = roundf(mx);
iy = roundf(my);
ix = (int)(mx + 0.5f);
iy = (int)(my + 0.5f);
if(ix < 0 || ix >= 512 || iy < 0 || iy >= 424)
index = -1;
else
Expand All @@ -255,7 +255,7 @@ Registration::Registration(Freenect2Device::IrCameraParams depth_p, Freenect2Dev
*map_x++ = rx;
*map_y++ = ry;
// compute the y offset to minimize later computations
*map_yi++ = roundf(ry);
*map_yi++ = (int)(ry + 0.5f);
}
}
}
Expand Down