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