typo/bug in function cvProjectPoints2 ?

asked 2016-04-05 16:32:43 -0600

updated 2016-04-06 01:51:50 -0600

berak gravatar image

A typo/bug in modules\calib3d\calibration.cpp, function cvProjectPoints2 ?

According to the distortion definition we have:

xd = x*cdist*icdist2 + k[2]*a1 + k[3]*a2;  (line 1007)

 yd = y*cdist*icdist2 + k[2]*a3 + k[3]*a1;

 m[i].x = xd*fx + cx;

 m[i].y = yd*fy + cy;

where 
a1 = 2*x*y;
 a2 = r2 + 2*x*x;
 a3 = r2 + 2*y*y;

whereas a derivative (line 1080)

double dmxdt = fx*(dxdt[j]*cdist*icdist2 + x*dcdist_dt*icdist2 + x*cdist*dicdist2_dt +
                                       k[2]*da1dt + k[3]*(dr2dt + 2*x*dxdt[j]));

Should the last term be equal 4*x*dxdt[j] ?

Similar places in calculations of dmydt, dmxdr, and dmydr

edit retag flag offensive close merge delete

Comments

From the information you wrote, I am inclined to be agree with you.

What you could do is to open an issue here.

Also, what happens if you "correct" the formulas and compare the result ?

Eduardo gravatar imageEduardo ( 2016-04-07 09:51:10 -0600 )edit

The issue has been submitted here and has been fixed also with the corresponding pull requests.

Eduardo gravatar imageEduardo ( 2016-09-09 09:06:10 -0600 )edit