Camera parameters conversions

Let us recall the pinhole camera model implemented in ViSP. In this model, a scene view is formed by projecting 3D points into the image plane using a perspective transformation.

where:

are the coordinates of a 3D point in the camera frame

are the coordinates in pixels of the projected 3D point

is a principal point that is usually near the image center

are the focal lengths expressed in pixel units.

When , the previous equation si equivalent to the following:

Real lenses usually have some radial distortion. So, the above model is extended as:

where is the first order radial distorsion. Higher order distorsion coefficients are not considered in ViSP.

Note

In ViSP we introduce an extra parameter named which is the radial first order distorsion that allows to transform pixels in meters. If this parameter is unknown as in OpenCV a good approximation is to consider

Even if OpenCV notations are different, this model is exactly the same then the one used in OpenCV and described here where higher order OpenCV distorsion parameters are turned to 0.

The following table gives the correspondances between ViSP and OpenCV parameters:

From a coding point of view, let us consider the following code also available in tutorial-bridge-opencv.cpp where we initialize camera parameters using ViSP: