Camera Calibration Tool - Camera Model
|
Description of the intrinsic camera model
After calibration, the intrinsic camera model may be saved into a text file by clicking on the "Save" button in the property control window. An example of such a file is CalibResult.txt:
Camera Matrix:
M[0,0]= 286.2791138 M[0,1]= 0.0000000 M[0,2]= 156.6844177
M[1,0]= 0.0000000 M[1,1]= 287.7630615 M[1,2]= 130.9805145
M[2,0]= 0.0000000 M[2,1]= 0.0000000 M[2,2]= 1.0000000
Distortion:
D[0]= -0.416691
D[1]= 0.250142
D[2]= -0.000386
D[3]= -0.001894
This complete intrinsic camera model is encoded with the matrix M (also known as camera matrix) and the vector D (distortion vector).
Definition of the intrinsic parameters:
Let us make slight changes in notation: (numerical values are included for clarity purposes only - when running calibration on your camera, you will naturally obtain a different set of numerics)
-
Focal length: The focal length in pixels is the 2x1 vector fc = [ M[0,0] ; M[1,1] ] = [286.3 ; 287.8].
-
Principal point: The principal point in pixels is the 2x1 vector cc = [ M[0,2] ; M[1,2] ] = [156.7 ; 131].
-
Skew coefficient: The skew coefficient related to the angle between the x and y pixel axes is the scalar s = M[0,1] = 0.
-
Distortion: The image distortion coefficients
are k1 = D[0] = -0.416691, k2 = D[1] = 0.250142, p1 = D[2] = -0.000386 and p2 = D[3] = -0.001894. The coefficients k1 and k2 are associated to radial distortions (up to the fourth order), and p1 and p2 are associated to tangential distortions.
A zero skew (s=0) means that the pixels are rectangular on the
sensor. In that present release of the calibration software, the
camera model will always assume rectangular pixels (or zero
skew). This assumption is valid for most current imaging sensors. In future
releases, a complete estimation of the skew coefficient will be included.
The next section provides detailed definitions of the entire set of intrinsic parameters.
Description of the pixel projection operator:
Let us make slight changes in notation: (numerical values are included for clarity purposes only - when running calibration on your camera, you will naturally obtain a different set of numerics)
Let P be a point in space of coordinate vector XXc
= [Xc;Yc;Zc] in the camera reference
frame.
Let us project now that point on the image plane according to the intrinsic
parameters (fc,cc,s,k1,k2,p1,p2).
Let xn be the normalized (pinehole) image projection:
Let r2 = x2 + y2.
After including lens distortion, the new normalized point coordinate
xd
is defined as follows:
xd
|
=
|
|
|
|
=
|
(1 + k1*r2 + k2*r4) * xn + dx
|
where dx is the tangential distortion vector:
dx |
= |
|
2*p1*x*y + p2*(r2 + 2*x2)
|
|
p1*(r2 + 2*y2) + 2*p2*x*y
|
|
|
|
It is worth noticing that this distortion model was first introduced
by Brown in 1966 and called "Plumb Bob" model (radial polynomial +
"thin prism" ). The tangential distortion is due to "decentering", or imperfect centering of the lens components and other manufacturing defects in a compound lens.
Once distortion is applied, the final pixel coordinates x_pixel = [xp;yp]
of the projection of P on the image plane is:
xp = fc(1)*xd(1) + s*xd(2) + cc(1)
|
yp = fc(2)*xd(2) + cc(2)
|
Therefore, the pixel coordinate vector x_pixel and the normalized (distorted) coordinate vector xd are related to each other through the linear equation:
where M is known as the camera matrix, and defined as follows:
Observe that this matrix is exactly the same as the one appearing in the original text file generated by the calibration tool
Notice that fc(1) and fc(2) are the focal
distance (a unique value if expressed in mm) expressed in units of horizontal and vertical
pixels. Therefore, the camera model naturally handles non-square
pixels. In addition, the coefficient s encodes the angle
between the x and y sensor axes. Consequently, this generic model allows for non-rectangular pixels (altough this release of the software does not explicitly estimate the skew coefficient - future ones will). Some authors refer to that generic type of model as
"affine distortion" model.
Convention: The pixel coordinates are defined such that [0;0] is the
upper left pixel of the image (the center of the pixel),
[nx-1;0] is the upper right corner pixel, [0;ny-1] is
the lower left corner pixel and [nx-1;ny-1] is the lower right
corner pixel where nx and ny are the width and height of
the image (for example nx=640 and
ny=480).
For more information, refer to the tutorial page on Camera Calibration and try the Matlab implementation provided with it.
Back to main camera calibration page