cv::undistort and values of distortion coefficent
Hi!
I'm porting to opencv a little script for lens distortion correction.
This program is doing the undistortion with the Brown normalization, and it uses some parameters that gets out of a (close source) software for camera calibration that has values in the so called photogrammetric representation.
The main difference I have noticed till now is that it express values of focal length and principal points in mm while opencv undistort function takes values in pixel. Ok, I have pixel dimension and I can do this conversion.
But.. Even after this conversion the cv::undistort function still gets me an image that is not correctly undistorted.
I think that there should be some scaling factor that I'm not considering. So I'm asking: what are the values of distortion coefficent units? Are they in radians? Or there is some other conversion that I have to do? Some advice?
EDIT: I report the name of the log and how I'm using it (referring to opencv cv::undistort documentation):
Camera interior orientation: focal length (mm), principal point (mm). Radial distortion parameters: k1, k2, k3 Decentring distortion parameters: p1, p2 Affinity, non-orthogonality parameters: b1, b2
I'm using focal length parameter (scaled in pixel) for fx anf fy, principal point (scaled in pixel as well) as cx, cy. k1, k2, k3, p1, p2 as they are b1, b2: not using those parameters.
Can you post all the values for the variables mentioned above, including image width x height.