The Pinhole Camera

The pinhole camera is the simplest geometric model of how a camera forms an image. All light entering the camera passes through a single point, the optical center, before reaching a flat image plane. Every 3D point in the world projects to a 2D point on this plane along a straight ray through the optical center.

Three coordinate frames are used:

  • World frame: — positions of objects in the scene.
  • Camera frame: — origin at the optical center, -axis pointing forward along the optical axis, to the right, down (or up, depending on convention).
  • Image (pixel) frame: — indexed from a corner of the sensor.

The map world → camera → image composes three operations:

  1. Extrinsics (rigid transformation): , where is the camera’s orientation and its position.
  2. Perspective projection onto the image plane at :
  3. Intrinsics (pixelation): multiply by the intrinsic matrix

    where are focal lengths in pixels and is the principal point (pixel where the optical axis meets the image).

In homogeneous coordinates, the composite projection is

where is the projective scale factor. Dividing the homogeneous result by gives the pixel coordinates.

The Pinhole Inversion front of the optical center, and the image is inverted (flipped horizontally and vertically). Real cameras place the sensor behind the pinhole, which is geometrically equivalent but produces an uninverted image.

In pure pinhole geometry the image plane lies in

Intuition

A camera takes a 3D world and flattens it onto a 2D image. The pinhole model makes this flattening exact and geometric: each pixel corresponds to a single ray through the optical center, and the scene point that produced the pixel is somewhere along that ray. The division by in the projection formula is the single most important feature of the model — it is perspective foreshortening, the reason distant objects look smaller, and the reason a single image cannot tell you how far away anything is (the ray alone is known; the depth along the ray is lost).

The intrinsic and extrinsic decomposition is what makes the model composable. Extrinsics tell you how the camera is placed in the world; intrinsics tell you how the camera turns metric-units rays into pixel-units measurements. Calibration, stereo, and multi-view reconstruction all rest on this split: extrinsics change as the camera moves, intrinsics stay fixed.

Properties

Projection

(Perspective division) Depth scaling is the hallmark of projection: .

The division by encodes that a point twice as far away projects to half the image-space offset. Translated into images, this is why two parallel rails appear to converge to a vanishing point — the ratio tends to a limit as .

(Loss of depth) A single image determines the ray through each pixel but not the depth along it.

Given a pixel and known intrinsics , one can recover the ray in camera coordinates, but the scene point could lie anywhere along that ray. Recovering depth requires a second view (stereo), motion (SfM), or active sensing (structured light, LiDAR).

(Homogeneous projection matrix) The full projection matrix is .

In homogeneous coordinates the projection reads as a linear map. This linearity is what makes projective multi-view geometry tractable: epipolar constraints, triangulation, and bundle adjustment all rely on working in homogeneous coordinates so that the nonlinear “divide by ” disappears from the estimator and returns only at the final de-homogenization.

Intrinsic Parameters

(Focal length) and are the focal lengths measured in pixels.

In physical units is a distance (millimeters). Converting to pixels requires multiplying by the sensor-pixel density: where is the pixel pitch along . Non-square pixels produce ; for most modern sensors these are equal to within measurement precision.

(Principal point) is the pixel location where the optical axis pierces the image.

Ideally the principal point is at the image center, but manufacturing tolerances shift it by a few pixels. Calibration recovers along with .

(Skew) The off-diagonal entry of encodes sensor axis non-orthogonality and is almost always zero for modern sensors.

Some texts write with a skew parameter in the position. It accounts for the angle between and sensor axes deviating from 90° and is negligible for CMOS/CCD sensors.

Extrinsic Parameters

(Rigid body transform) Extrinsics describe the camera’s pose.

rotates the world frame into the camera frame; translates the world origin into the camera frame. Together they specify where the camera is and where it is looking. When multiple cameras share a scene, their relative pose is the input to epipolar geometry.

(Calibration recovers intrinsics) A standard Zhang calibration recovers , , from images of a known planar target.

Several views of a checkerboard of known dimensions give enough correspondences to fit via the DLT, then refine jointly with per-view by minimizing reprojection error. OpenCV’s calibrateCamera is the standard implementation.

Limitations

(No lens distortion) Real lenses deviate from the pinhole model at wide fields of view.

Radial distortion (barrel and pincushion) bends straight lines near the image edges; a standard correction is the Brown-Conrady model

whose coefficients are fit alongside during calibration. After undistortion the pinhole model holds to sub-pixel accuracy.

(No finite aperture) The pinhole model assumes an infinitesimal aperture, so everything is in focus.

Real cameras have finite apertures and depth-of-field effects (blur away from the focal plane). For small apertures the pinhole model is an excellent approximation; for large apertures (shallow DoF) the thin-lens model is needed.

Examples

Pixel Coordinates from a World Point

A camera at world origin with , , px, . Where does the world point project?

Ray from a Pixel

Given a pixel and the same intrinsics, what ray in camera coordinates does it correspond to?

See Also