Skip to content
AI360Xpert
Computer Vision
Visual explainer

Camera Projection and Pinhole Model

How a 3D world maps to a 2D sensor using the pinhole model and similar triangles.

A camera converts our three-dimensional world into a two-dimensional grid of pixels. This dimensional reduction is the foundational problem of computer vision.

The 3D world mapped to a 2D sensor.
The 3D world mapped to a 2D sensor.

To map 3D points mathematically, we use the Pinhole Camera Model. Light rays from an object pass through a tiny aperture (the pinhole) to form an inverted image on the sensor plane.

Rays passing through a pinhole invert the image.
Rays passing through a pinhole invert the image.

The focal length (ff) is the distance between the pinhole and the sensor. A longer focal length produces a larger, "zoomed in" projection, while a shorter focal length creates a wider field of view.

Longer focal lengths mean larger projections.
Longer focal lengths mean larger projections.

Because light travels in straight lines, projection becomes a problem of similar triangles. The relationship between the object's real height YY at distance ZZ, and its projected pixel height yy at focal length ff, is a simple ratio.

y = f * (Y / Z)
y = f * (Y / Z)

This simple equation y=fYZy = f \cdot \frac{Y}{Z} tells us something profound: depth (ZZ) is inextricably linked to scale. An object appearing small on the sensor could be tiny and close, or huge and far away. We've lost one dimension entirely.