In computer vision a camera matrix or (camera) projection matrix is a
Contents
- Derivation
- Camera position
- Normalized camera matrix and normalized image coordinates
- The camera position
- General camera matrix
- References
Let
where
Since the camera matrix
Derivation
The mapping from the coordinates of a 3D point P to the 2D image coordinates of the point's projection onto the image plane, according to the pinhole camera model is given by
where
To derive the camera matrix this expression is rewritten in terms of homogeneous coordinates. Instead of the 2D vector
Finally, also the 3D coordinates are expressed in a homogeneous representation
where
and the corresponding camera matrix now becomes
The last step is a consequence of
The camera matrix derived here may appear trivial in the sense that it contains very few non-zero elements. This depends to a large extent on the particular coordinate systems which have been chosen for the 3D and 2D points. In practice, however, other forms of camera matrices are common, as will be shown below.
Camera position
The camera matrix
This is also the homogeneous representation of the 3D point which has coordinates (0,0,0), that is, the "camera center" (aka the entrance pupil; the position of the pinhole of a pinhole camera) is at O. This means that the camera center (and only this point) cannot be mapped to a point in the image plane by the camera (or equivalently, it maps to all points on the image as every ray on the image goes through this point).
For any other 3D point with
Normalized camera matrix and normalized image coordinates
The camera matrix derived above can be simplified even further if we assume that f = 1:
where
So far all points in the 3D world have been represented in a camera centered coordinate system, that is, a coordinate system which has its origin at the camera center (the location of the pinhole of a pinhole camera). In practice however, the 3D points may be represented in terms of coordinates relative to an arbitrary coordinate system (X1',X2',X3'). Assuming that the camera coordinate axes (X1,X2,X3) and the axes (X1',X2',X3') are of Euclidean type (orthogonal and isotropic), there is a unique Euclidean 3D transformation (rotation and translation) between the two coordinate systems. In other words, the camera is not necessarily at the origin looking along the z axis.
The two operations of rotation and translation of 3D coordinates can be represented as the two
where
Assuming that
where
Assuming also that the camera matrix is given by
Consequently, the camera matrix which relates points in the coordinate system (X1',X2',X3') to image coordinates is
a concatenation of a 3D rotation matrix and a 3-dimensional translation vector.
This type of camera matrix is referred to as a normalized camera matrix, it assumes focal length = 1 and that image coordinates are measured in a coordinate system where the origin is located at the intersection between axis X3 and the image plane and has the same units as the 3D coordinate system. The resulting image coordinates are referred to as normalized image coordinates.
The camera position
Again, the null space of the normalized camera matrix,
This is also, again, the coordinates of the camera center, now relative to the (X1',X2',X3') system. This can be seen by applying first the rotation and then the translation to the 3-dimensional vector
This implies that the camera center (in its homogeneous representation) lies in the null space of the camera matrix, provided that it is represented in terms of 3D coordinates relative to the same coordinate system as the camera matrix refers to.
The normalized camera matrix
where
General camera matrix
Given the mapping produced by a normalized camera matrix, the resulting normalized image coordinates can be transformed by means of an arbitrary 2D homography. This includes 2D translations and rotations as well as scaling (isotropic and anisotropic) but also general 2D perspective transformations. Such a transformation can be represented as a
Inserting the above expression for the normalized image coordinates in terms of the 3D coordinates gives
This produces the most general form of camera matrix