Robot Vision & Perception

pinhole camera model

The pinhole camera model is the simple, idealized picture of how a camera turns the three-dimensional world into a flat image. Imagine a dark box with one tiny hole punched in the front. Light from a point in the world travels in a straight line, slips through that single hole, and lands on the back wall of the box, painting an upside-down image there. Because every ray must pass through the same little hole, the model treats the camera as a single point in space — and that one assumption is enough to predict exactly where any real-world point will show up in the photo.

The geometry that follows is just similar triangles. A point that is twice as far away appears half as large; the deeper rule is that an object's image size shrinks inversely with its distance — double the distance, halve the image — and is scaled up by the camera's focal length (how far the back wall sits behind the hole). This is the heart of projection: collapsing three numbers of position down to two numbers on a flat sensor. The model is what lets a robot reason backward — from a pixel, it knows the ray of directions that pixel could have come from, even though it cannot tell distance from one image alone.

Real lenses are not pinholes, so the model is an approximation. It ignores blur, the bending of light by glass, and lens distortion that bows straight lines into curves. But it is so clean and useful that nearly all of robot vision starts here and then adds small corrections on top, rather than throwing the model away.

A robot photographs a 2-meter doorway from 4 meters away with a camera whose focal length spans 800 pixels. By the pinhole rule, the doorway projects to about 400 pixels tall in the image — distance halves the result, image size halves.

Same physical object, half the image size at double the distance — the core prediction of the pinhole model.

The image really does form upside-down behind a true pinhole; in math and software the picture is usually flipped to a virtual image plane in front of the hole so the result is right-side up.

Also called
pinhole projection针孔成像模型針孔成像模型