Skip to content

Commit 2a3a948

Browse files
committed
Merge pull request #345 from AliShug/master
Remove `roundf()` use from Registration
2 parents 89ee90d + 4fd5fb7 commit 2a3a948

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/protonect/src/registration.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ Registration::Registration(Freenect2Device::IrCameraParams depth_p, Freenect2Dev
241241
// compute the dirstored coordinate for current pixel
242242
distort(x,y,mx,my);
243243
// rounding the values and check if the pixel is inside the image
244-
ix = roundf(mx);
245-
iy = roundf(my);
244+
ix = (int)(mx + 0.5f);
245+
iy = (int)(my + 0.5f);
246246
if(ix < 0 || ix >= 512 || iy < 0 || iy >= 424)
247247
index = -1;
248248
else
@@ -255,7 +255,7 @@ Registration::Registration(Freenect2Device::IrCameraParams depth_p, Freenect2Dev
255255
*map_x++ = rx;
256256
*map_y++ = ry;
257257
// compute the y offset to minimize later computations
258-
*map_yi++ = roundf(ry);
258+
*map_yi++ = (int)(ry + 0.5f);
259259
}
260260
}
261261
}

0 commit comments

Comments
 (0)