sorry for the delay, i was experimenting a bit with this.
I usually do this manually, but you have an extreme case.
I need you to send me and image of the setup without any correction, use bonsai to save it, screenshot in this case are not that useful.
meanwhile can you try to set those options:
- CV_CALIB_FIX_PRINCIPAL_POINT The principal point is not changed during the global optimization. It stays at the center or at a different location specified when
CV_CALIB_USE_INTRINSIC_GUESS is set too. - CV_CALIB_FIX_ASPECT_RATIO The functions considers only
fy as a free parameter. The ratio fx/fy stays the same as in the input cameraMatrix . When CV_CALIB_USE_INTRINSIC_GUESS is not set, the actual input values of fx and fy are ignored, only their ratio is computed and used further. - CV_CALIB_ZERO_TANGENT_DIST Tangential distortion coefficients
are set to zeros and stay zero
FixPrincipalPoint:
what i want you to see is if the principal point stays in the center of the ccd, that is half of the resolution,
This parameter is not really important to optimize. This just means that lens axis is really pointing to the center of the image. on a really bad lens it can be several pixels of. Usually is more than good.
FixAspect Ratio FxFY:
If you fix this you are just telling that the physical pixels of the sensor are squares, they always are.
Tangent Distortion
Next thing is the tangential distortion, this just means that the lens plane is parallel to the sensor plane, they are never aligned, but usually even in cheap cameras it is just an infinitesimal part of a degree.
FixFocalDistance
This one is important when you have 3d movement in the space, is just a factor to some other parameters and a way to know the real Z distance of a maker. In here is not important at all.
I usually fix it at 1000
You can play with undistort, by fixing some of those values and use the distortion parameters stating from zero, and them changing them by small amounts one at a time.
You gain some insight of what those parameters try to correct.
Joao