This chapter addresses the problem of describing how light incident on objects is recorded by a digital sensor. This concept is fundamental to image processing because it provides the relationship between image points and their positions in the world. In other words, it makes it possible to determine the locations in space associated with an image pixel or, conversely, to identify the image region that captures a given region in world coordinates.
The most commonly used projection model, known as the Pin-Hole Camera, is based on simple geometric ratios9.1.
Figure 9.1 shows a highly simplified diagram of how an image is formed on the sensor.
The observed point
, expressed in camera coordinates, is projected onto the sensor plane.
All these rays pass through the same point: the projection center (pin-hole).
|
As shown in Figure 9.1, the ratios between the similar triangles formed by the optical rays describe the equation used to project an arbitrary point
, expressed in camera coordinates (one of the coordinate systems in which we can work), onto the sensor plane:
Note that the coordinates
, expressed in the camera coordinate system, follow a different convention from that used for world coordinates. In what follows, this difference will be accounted for by an axis-permutation matrix
, keeping the choice of coordinate system separate from the camera's physical rotation. The coordinate
therefore represents the point's depth along the camera's optical axis.
Defining
Equation (9.1) can therefore also be written as
| (9.3) |
Normalized coordinates thus form an intermediate space between the three-dimensional scene geometry and the discrete image coordinates. Many computer vision algorithms, such as pose estimation, triangulation, and epipolar geometry, assume that image points are expressed in this coordinate system.
Sensor coordinates
are not yet the coordinates of the digital image, but rather “intermediate” coordinates expressed in the sensor's physical units.
An additional transformation is therefore required to obtain image coordinates:
and
are conversion factors between the units of the sensor coordinate system, typically metric units, and those of the image, measured in pixels.
For square pixels, the two conversion factors are equal.
When information about ,
, and
is unavailable (for example, in the various datasheets), these variables are often combined into two new parameters,
and
: the effective focal lengths measured in pixels, which can be estimated empirically from images, as discussed in the section on calibration.
These variables are defined as
Using normalized image coordinates, the transformation to pixel coordinates is therefore
If the principal point approximately coincides with the image center, and
can also be related to half the field of view:
| (9.7) |
For a sensor with square pixels, and
tend to have the same value.
Because of the division by , Equation (9.1) cannot be directly represented by a linear transformation in Cartesian coordinates.
However, it can be rewritten by introducing a scale factor
, allowing the projection to be represented as a linear system in homogeneous coordinates.
To do this, we use the theory of homogeneous coordinates presented in Section 1.5.
The transformation between normalized image coordinates and pixel coordinates can be represented by the intrinsic parameter matrix
If , then
| (9.9) |
Recalling that
For this reason, is normally left implicit, and homogeneous coordinates are used: to obtain the point in non-homogeneous coordinates, simply divide the first two coordinates by the third.
Homogeneous coordinates thus make division by the coordinate
implicit.
The matrix depends only on the camera's internal parameters and is therefore called the intrinsic parameter matrix.
In the general case, it is an upper triangular matrix defined by five parameters.
With modern digital sensors, the skew factor , which accounts for the angle between the sensor axes not being exactly
, can normally be set to zero.
Setting , the inverse of matrix (9.8) can be written as
In particular, the inverse intrinsic matrix transforms an image point into the corresponding normalized image coordinates:
| (9.12) |
Knowing these parameters (see Section 9.5 on calibration) makes it possible to transform a point from camera coordinates to image coordinates or, conversely, to generate the camera-coordinate ray corresponding to an image point.
In particular, the vector
| (9.13) |
This model, however, does not account for lens distortion. The pin-hole camera model is valid only when the image coordinates being used refer to distortion-free images.