Lably
Skip to content

Camera matrix

Computer vision geometry concept

  • 5 min read
  • 4 chapters

Related on Lably

Through Computer vision, Matrix (mathematics) and Pinhole camera

Let x be a representation of a 3D point in homogeneous coordinates (a 4-dimensional vector), and let y be a representation of the image of this point in the pinhole camera (a 3-dimensional vector). Then the following relation holds

y∼Cx

where C is the camera matrix and the ∼ sign implies that the left and right hand sides are equal except for a multiplication by a non-zero scalar k≠0:

y=kCx.

Since the camera matrix C is involved in the mapping between elements of two projective spaces, it too can be regarded as a projective element. This means that it has only 11 degrees of freedom since any multiplication by a non-zero scalar results in an equivalent 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

(y1y2)=fx3(x1x2)

where (x1,x2,x3) are the 3D coordinates of P relative to a camera centered coordinate system, (y1,y2) are the resulting image coordinates, and f is the camera's focal length for which we assume f > 0. Furthermore, we also assume that x3 > 0.

To derive the camera matrix, the expression above is rewritten in terms of homogeneous coordinates. Instead of the 2D vector (y1,y2) we consider the projective element (a 3D vector) y=(y1,y2,1) and instead of equality we consider equality up to scaling by a non-zero number, denoted ∼. First, we write the homogeneous image coordinates as expressions in the usual 3D coordinates.

(y1y21)=(fx3x1fx3x21)∼(x1x2x3f)

Finally, also the 3D coordinates are expressed in a homogeneous representation x and this is how the camera matrix appears:

(y1y21)∼(10000100001f0)(x1x2x31) or y∼Cx

where C is the camera matrix, which here is given by

C=(10000100001f0),

and the corresponding camera matrix now becomes

C=(10000100001f0)∼(f0000f000010)

The last step is a consequence of C itself being a projective element.

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.

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Robotics