librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

rs_deproject_pixel_to_point() elucidation

Open andakkino opened this issue 9 years ago • 3 comments

Hello GoodEvening to everybody, I'm looking at the source code of rs_deproject_pixel_to_point() function,

https://github.com/IntelRealSense/librealsense/blob/master/include/librealsense/rsutil.h line 43 in particular;

float f = 1 + intrin->coeffs[0]*r2 + intrin->coeffs[1]*r2*r2 + intrin->coeffs[4]*r2*r2*r2;

why coeffs[4]? It should be coeffs[2], in that formula it must consider the radial distortion coefficents instead. coeffs[4] is instead a tangential distortion coefficent.

Am I wrong? Can anyone help me to understand this function (and in particular the used formula) ?

thanks for your help.

andakkino avatar Apr 20 '17 15:04 andakkino

the distortion equation is the same as used in openCV (and the coefficient order is the same) : http://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html

the order is k1, k2, p1, p2, k3. It's standard order that allow to use the vector from one library to the other, and I think the reason is that it s ordered by importance k1 > k2 > p1,p2 > k3

delmottea avatar Apr 26 '17 07:04 delmottea

It's not the same as opencv. Notice the difference in how tangential distortion is computed

leonidk avatar Apr 26 '17 23:04 leonidk

oh, I didn't see it, thanks.

delmottea avatar Apr 27 '17 01:04 delmottea