The camera projection matrix packs the whole imaging process into one matrix that maps a 3D world point to a pixel. It builds directly on the Pinhole Camera and Perspective Projection and uses Homogeneous Coordinates so that the perspective division becomes a single matrix product.
The Chain From World to Pixel
flowchart LR W["World point X (4x1)"] -->|"[R | t] extrinsics"| C["Camera coordinates"] C -->|"canonical projection [I | 0]"| N["Normalized image point"] N -->|"K intrinsics"| P["Pixel (u, v)"]
- Extrinsic parameters place the camera in the world: a rotation and a translation (6 numbers).
- Intrinsic parameters describe the camera itself: focal length(s), principal point, pixel scaling (and optionally skew).
Normalized Camera Coordinates
In the normalized camera coordinate system the camera center is the origin, the principal axis is the axis, and . Projection is then
where means “equal up to scale”: divide by the third coordinate to read off . These coordinates depend only on the direction of the ray, so any two cameras at the same pose see the same normalized point.
Intrinsics: the Calibration Matrix
Two things turn normalized coordinates into pixels:
- The focal length scales by (or for non-square pixels).
- The principal point , where the optical axis meets the image plane, is the origin in camera coordinates, but pixel coordinates put the origin in the image corner, so we shift by .
Extrinsics: Rotation and Translation
If is the camera center in world coordinates and a world point, the point in the camera frame is
First translate so the camera sits at the origin, then rotate. In homogeneous form this is the matrix .
The Full Matrix
- is defined up to scale, which leaves 11 degrees of freedom: 5 intrinsic (, skew, ) and 6 extrinsic.
- To project: compute , then divide by the third coordinate.
The camera center is the null space of
In homogeneous world coordinates the camera center is , and
Its projection is , which is undefined: the camera center is the one point that has no image.
Worked Example
Intrinsics: , principal point . The camera is unrotated () and sits at . The world point is .
- World to camera: .
- Normalize: . No focal length yet.
- Apply : , .
The pixel is .
Going Backward: Pixel to Ray
Applying to a pixel gives a normalized point , which is the direction of the viewing ray in camera coordinates. For pixel with the same : . Every point along that ray projects to the same pixel, so depth cannot be recovered from one image. It needs a known depth or a second view where two rays intersect.
Calibration
Camera calibration estimates the transformation from world to image coordinates, that is , or , and . The standard approach photographs an object with known 3D points and measures their pixel positions. Each correspondence gives two linear equations in the entries of , so with 11 degrees of freedom at least 6 correspondences are needed. Solving them by homogeneous least squares is the same method as the Homographies and Perspective Warping estimate.
Sources: Camera resectioning (Wikipedia); Hartley and Zisserman, Multiple View Geometry in Computer Vision. The 6-correspondence count follows from the degrees of freedom above (standard result, my own derivation).
Related: Computer Vision MOC, Pinhole Camera and Perspective Projection, Homogeneous Coordinates, Image Warping, Least-Squares Line Fitting