Ask Your Question

Revision history [back]

typo/bug in function cvProjectPoints2 ?

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

According to the distortion definition we have:

xd = xcdisticdist2 + k[2]a1 + k[3]a2; (line 1007)

yd = ycdisticdist2 + k[2]a3 + k[3]a1;

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

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

where a1 = 2xy; a2 = r2 + 2xx; a3 = r2 + 2yy;

whereas a derivative (line 1080)

double dmxdt = fx(dxdt[j]cdisticdist2 + xdcdist_dticdist2 + xcdistdicdist2_dt + k[2]da1dt + k[3](dr2dt + 2x*dxdt[j]));

Should the last term be equal 4xdxdt[j] ?

Similar places in calculations of dmydt, dmxdr, and dmydr

click to hide/show revision 2
No.2 Revision

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

berak gravatar image

typo/bug in function cvProjectPoints2 ?

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

According to the distortion definition we have:

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

1007)

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

k[3]*a1;

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

cx;

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

cy;

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

2*y*y;

whereas a derivative (line 1080)

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

2*x*dxdt[j]));

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

Similar places in calculations of dmydt, dmxdr, and dmydr