i am reading the tutorial https://docs.opencv.org/3.4.2/d4/d94/tutorial_camera_calibration.html and it seems to me there might be an error in the formulas
xdistorted=x+[2p1xy+p2(r^2+2x^2)]
ydistorted=y+[p1(r^2+2y^2)+2p2xy]
the reason is that the terms p2(r^2+2x^2) and p1(r^2+2y^2)should always be positive no matter what sign of p1 or p2 so i don't know might be the correct formula are
xdistorted=x+[2p1xy+p2^2(r^2+2x^2)]
ydistorted=y+[p1^2(r^2+2y^2)+2p2xy]
for instance if the camera is tilted upwards i might assume p1>0 p2=0
xeffective=x+[2p1xy] (linear correction in x, increasing in half of the plane, decreasing in the other half)
yeffective=y+[p1(r^2+2y^2)] (y always corrected increasing it)
and that would quite work i guess
but i i would really not understand the case camera downwards and p1<0 p2=0 in that case y would be wrongly corrected??!!
am i misunderstanding the formulas??
please help thanks