Image Formation & Foundations

pinhole camera model

The pinhole camera model is the simplest faithful account of how a 3D world becomes a 2D image. Picture a sealed box with a single tiny hole in one face. Light from each scene point travels in straight lines; only the ray that passes through the hole reaches the opposite inner wall, painting an inverted picture there. Because just one ray per direction gets through, every scene point maps to exactly one image point, with no blur — an idealization that makes the geometry clean and analyzable.

Formally, place the pinhole at the origin (the center of projection) and the image plane at distance f (the focal length) in front of it. A scene point with camera coordinates (X, Y, Z) projects to image coordinates x = f X / Z and y = f Y / Z. This single division by depth Z is the heart of imaging: it is why distant things look small and why parallel lines appear to converge. To avoid the awkward upside-down image, we usually adopt the virtual image plane in front of the pinhole, which removes the sign flip but keeps the same equations.

The model is the foundation of the whole geometric pipeline of computer vision: camera calibration, stereo, structure-from-motion, visual SLAM and the projection used inside NeRF and 3D Gaussian splatting all build on pinhole projection, then bolt corrections onto it. A real lens differs from a pinhole in two important ways — it gathers light over a finite aperture (so it must focus, and has depth of field) and it bends rays (introducing distortion) — but to first order a well-focused lens behaves like a pinhole, which is why this idealization is so powerful.

A true pinhole always projects a point to a point regardless of depth, so it has infinite depth of field but lets in very little light, forcing long exposures. Lenses trade this away: they gather much more light at the cost of finite depth of field and distortion. The model is geometric idealization, not a buildable bright camera.

Also called
camera obscura model