The rectangle behind the lens

The centre has an area

Every theorem of perspective follows from a projection through a point, and no instrument has one. Give the pupil a radius and each world point images as a disc — whose centre is the pinhole's mark to 5.7 × 10⁻¹⁴ millimetres, at every aperture, every distance and every field angle. The geometry survives exactly; only the sharpness is spent.

Worth reading first: A focal length is not an angle · The eye is a place, not a point.

Every projection on this site goes through a point. That is the sentence lib/camera.js implements, the one recovering the camera gets back out of a picture, and the one every theorem quoted anywhere here follows from.

No instrument has one. A camera gathers light through a hole with a diameter, an eye through a pupil four millimetres across, a projector through a lens. The pinhole is what is left when that diameter goes to zero, and it never does.

The eye is a place, not a point established where the centre is and what rotating about anywhere else costs. This essay gives it a radius.

The model, stated

A thin lens of focal length f, a circular pupil of radius R on the axis, a sensor at distance v₀ behind it. Everything in millimetres of a real camera, with the sensor format converting to the pixels the rest of this collection works in.

The f-number written on a lens barrel is f/2R, so the pupil’s radius is f/2N — for a 50 mm lens at f/2.8, 8.93 millimetres. Focused at three metres, the sensor sits 50.85 millimetres behind the lens.

One line does the whole of the geometry. A ray from an object point through the pupil at height a passes through that object’s own image point, so its height at the sensor is the linear interpolation between the two:

u(a)=a+(ximga)v0vu(a) = a + (x_{\text{img}} - a)\,\frac{v_0}{v}

with v the distance at which the object actually focuses. When v = v₀ the a drops out, which is what in focus means written as an identity rather than as a description.

A point images as a disc 5.8 px across, centred on the pinhole's markA section through a 50 mm lens at f/2.8, focused at 3 metres, with a point at 1.5 metres. Rays leave the point, fill the pupil, cross at the point's own image plane and reach the sensor as a patch 0.303 millimetres across, which is 5.8 pixels in this collection's figures. The middle ray is the one a pinhole at the pupil's centre would have drawn, and the patch is centred on it to 1.0e-17 millimetres — which is the arithmetic floor, at every aperture and every distance. The geometry is untouched; only the sharpness is spent.a point at 1.5 mthe pupilthe sensorwhere it focusesf/2.8, focused at 3 m5.8 px across
Fig. 1 A section: rays from a point at 1.5 m filling the pupil, crossing at the point’s own image plane, and reaching the sensor as a patch.

The claim, and the number

Take the mean over the whole pupil of where the rays land, and compare it with the mark a pinhole at the pupil’s centre would have made.

Across three apertures, five distances and three field positions, the worst disagreement is 5.7 × 10⁻¹⁴ millimetres. That is the arithmetic floor, not a tolerance.

It is also easy to see why, once the interpolation above is written down: the mean over a symmetric pupil of a·(1 − v₀/v) is zero, so the centre is x_img·v₀/v, which works out to −X·v₀/Z — the pinhole’s mark exactly, with the object’s own focus distance cancelling out.

So the whole of this collection’s geometry is licensed. A vanishing point is where a pinhole would have put it. A cross-ratio survives. A recovered camera is the real camera. What a finite aperture spends is sharpness, and nothing else.

Seven distances, seven discs, every centre on the pinhole's mark to 2.9e-17 mmThe patch a point on the axis images as, at seven distances from 0.9 to 16 metres, drawn to a scale that is the same at every aperture. The lens is focused at 3 metres, where the patch collapses to a point; either side of it the disc grows, and it grows faster toward the camera than away from it, which is the asymmetry the depth of field inherits. Every disc is centred on the mark a pinhole at the pupil's centre would have made — worst departure 2.9e-17 millimetres across all seven, which is the floor of the arithmetic rather than a tolerance. The number over each disc is its diameter in the pixels of this collection's figures.13.50.9 m6.61.4 m2.52.1 m0.03.0 m1.84.4 m3.37.0 m4.716.0 mf/2.8, focused at 3 mcentres to 2.9e-17 mm
Fig. 2 Seven distances, seven discs to a common scale, every centre on the pinhole’s mark.

The control

An identity that always held would be a fact about the algebra. So the same measurement is made with the pupil not centred on the axis — a shifted stop, or a vignetted corner where the pupil is clipped on one side — and the mark moves by 0.106 millimetres, two pixels on this collection’s own figures.

That is a real and useful consequence rather than a formality. It says a lens whose effective pupil is asymmetric across the field has a centre of projection that wanders with position, which is the mechanism behind several small calibration residuals people attribute to distortion. And it says the symmetry, not the algebra, is what the exactness rests on.

What the disc’s size is

R|1 − v₀/v|, which is the second half of the closed form, and it is worth having in a shape a reader can use.

Substituting the thin-lens relation gives the diameter on the sensor as

c=f2NZZfZ(Zff)c = \frac{f^2}{N}\cdot\frac{|Z - Z_f|}{Z\,(Z_f - f)}

with Z_f the focus distance. The important features are all visible in it: it is zero at Z = Z_f; it grows without bound as Z approaches the focal length; and as Z → ∞ it approaches a finite limit f²/(N·Z_f), which is why a far background is never infinitely blurred and why a hyperfocal distance exists at all.

Measured on the 50 mm at f/2.8 focused at three metres: a point at 0.9 metres images as a disc 13.5 pixels across, at 2.1 metres 2.5, at 4.4 metres 1.9, at 16 metres 4.7. The near side is steeper, which is the asymmetry the sharp band is a decision inherits.

The blur diameter against distance, at four aperturesFour curves, one per aperture, all focused at 3 metres. Each is the diameter of the patch a point images as, in the pixels these figures are drawn at. Every curve touches zero at the focus distance and rises on both sides — steeply toward the camera, where the closest 1 metre costs more blur than the whole of the distance beyond, and gently away from it, where it climbs toward a finite limit as the point recedes to infinity. That limit is what makes a hyperfocal distance possible: past a certain focus setting the far side never exceeds the criterion at all.01020304000.5001distance of the point, in metres (powers of ten)diameter of the blur disc, in pixels of this collection's figuresf/1.4f/2.8f/5.6f/11focused at 3 m4 apertures
Fig. 3 The diameter against distance at four apertures, showing the zero at focus, the steep near side and the finite limit at infinity.
The blur diameter against distance, at four aperturesFour curves, one per aperture, all focused at 12 metres. Each is the diameter of the patch a point images as, in the pixels these figures are drawn at. Every curve touches zero at the focus distance and rises on both sides — steeply toward the camera, where the closest 1 metre costs more blur than the whole of the distance beyond, and gently away from it, where it climbs toward a finite limit as the point recedes to infinity. That limit is what makes a hyperfocal distance possible: past a certain focus setting the far side never exceeds the criterion at all.0204000.5001distance of the point, in metres (powers of ten)diameter of the blur disc, in pixels of this collection's figuresf/1.4f/2.8f/5.6f/11focused at 12 m4 apertures
Fig. 4 The same curves focused at twelve metres, where the far side has flattened onto its limit.

The blur is linear in inverse depth

The four measured diameters — 13.5, 2.5, 1.9 and 4.7 pixels at 0.9, 2.1, 4.4 and 16 metres — are the closed form evaluated four times, and rearranging it once puts the whole family in the coordinate the rest of this collection keeps arriving at.

Factor the expression the other way:

c=f2ZfN(Zff)1Z1Zf.c = \frac{f^{2} Z_{f}}{N\,(Z_{f} - f)} \left| \frac{1}{Z} - \frac{1}{Z_{f}} \right|.

The disc’s diameter is linear in the difference of reciprocals, exactly — the same coordinate a stereo pair’s disparity is linear in, and the same one a scroll’s sag turns out to live in. Blur is a disparity in the aperture rather than across a baseline, and it obeys the same law.

Three consequences drop out of that form, and none of them is visible in the version written in depths.

The blur is symmetric in 1/Z1/Z and not in ZZ. Two distances blur equally when 1/Z1+1/Z2=2/Zf1/Z_{1} + 1/Z_{2} = 2/Z_{f} — the focus distance is the harmonic mean of any two equally blurred depths. Focused at three metres, a point at 2.1 m is exactly as blurred as one at 5.25 m, which is what the measured 2.5 pixels at 2.1 m pairs with. The apparent asymmetry of the near and far sides is the depth axis being the wrong coordinate to look at it in.

The far side is bounded and the near side is not. Inverse depth runs from 1/Zf1/Z_{f} down to zero going outward, so the disc cannot exceed f2/(NZf)f^{2}/(N Z_{f}) — 5.69 px on this lens — however distant the object. Going inward it runs to infinity, so nothing bounds the near disc. The measured 4.7 px at sixteen metres is already 83% of everything the far half of the world can produce, and the remaining 17% is spread over the rest of the universe.

And the hyperfocal distance is that bound read backwards. Choosing an acceptable disc picks a value of 1/Z1/Zf|1/Z - 1/Z_{f}|, and focusing so that the acceptable interval reaches zero — that is, so that infinity is exactly at the edge of it — is the whole of the rule. Hyperfocal focusing is not a trick; it is the observation that the far end of the inverse-depth axis is a wall, and that a criterion which does not reach it is wasting the half of its interval that lies beyond.

Why this had to be checked

It is the kind of assumption that is obviously true and has never been written down here, which on this site is exactly the condition under which things turn out to be false.

Two of this collection’s own findings are of that shape. The camera basis was inverted for a whole phase and every check passed, because a consistent flip is a valid projection of a mirrored scene. A shared tick routine returned an empty array for a descending domain, so two figures carried no gridlines at all, at full gates, because every check asks whether a label fits and none asks whether it exists.

“The blur is centred on the sharp position” is a sentence of the same kind: everybody believes it, nothing on this site had run it, and the consequences of its being false would have been invisible — a systematic bias in every recovered vanishing point, growing with defocus, indistinguishable from lens distortion.

One projection, two routes: divide by depth, or multiply and divide laterThe same box through the site's pinhole and through a 4×4 projection matrix with the divide postponed until after clip space. The worst disagreement over all twelve edges is 4.0e-14 px, which is the noise floor of double precision rather than an approximation.x/z, y/z — the pinholeM·p, then divide by wworst disagreement 4.0e-14 px over 8 verticescorrect from 21 cm, at 160 mm wide42° across · near 0.1 m, far 1000 m
Fig. 5 The two routes to one camera, from the two-view field — the habit this essay is applying to the aperture.

Where it stops being true

Three places, each of which is a real lens rather than a quibble.

Vignetting. Toward the corner of the frame the pupil is clipped by the barrel, and a clipped pupil is not symmetric about its own centre. The mark then moves, by the amount the control above measures. This is the cat’s-eye aperture visible in the corners of an out-of-focus photograph, and it is a genuine departure from the identity.

Pupil aberration. In a real lens the entrance pupil is the image of the stop through the front group, and that image is not perfect: it moves and changes shape with field angle. The centre of projection therefore depends slightly on where in the frame the point is, which is one of the things a distortion model absorbs — and a lens destroys the invariant is where this collection measures what that absorption costs.

And a non-circular stop. A polygonal aperture is still symmetric about its centre if it has an even number of blades or is regular, so the identity survives — but a stop that is asymmetric, or one blade of which sticks, does move the mark.

None of these is large. All of them are of the same size as the residuals a careful calibration is trying to explain, which is the reason for naming them.

The pinhole is not the limit anybody uses

A remark on the other end of the same axis, because it is where the model’s honesty is easiest to check.

Shrinking the aperture does not improve a picture without bound: diffraction sets in and the disc grows again. That crossover is real optics rather than geometry and this collection does not compute it — but the crossing itself is geometry and has been met once already here, in a hole is not preserved’s own field, where a five-millimetre gap between leaves stops imaging itself and starts imaging the sun at half a metre.

That measurement is geometric and it is the same statement in a different costume: a hole is a pinhole camera when the source’s image through it is smaller than the hole, and an aperture when it is larger. The blur disc computed here is the second case, and where the two cross is a length that the geometry supplies.

The disc is the pupil’s own image

A way of reading the result that makes the exactness obvious and is worth having, because it also predicts the exceptions.

The patch a defocused point makes on the sensor is a picture of the pupil, projected from that point’s own image. It is a disc because the pupil is a disc; it is an ellipse toward the corners because the pupil is seen obliquely there; it is a cat’s eye where the barrel clips it; and it is a heptagon on a lens with seven blades, which is why out-of-focus highlights have visible edges.

So “the centre of the patch is the pinhole’s mark” is the same statement as “the centre of the pupil’s image is the image of the centre of the pupil”, which is true because projection is linear and the pupil is symmetric. Everything that breaks the identity breaks that symmetry.

That reading also says which measurements are safe on a defocused image. A centroid of a symmetric blob is safe. A centroid of a clipped blob — a highlight near the corner, half of which is cut off by vignetting — is not, and the bias is toward the frame’s centre.

Seven distances, seven discs, every centre on the pinhole's mark to 1.5e-17 mmThe patch a point on the axis images as, at seven distances from 0.9 to 16 metres, drawn to a scale that is the same at every aperture. The lens is focused at 3 metres, where the patch collapses to a point; either side of it the disc grows, and it grows faster toward the camera than away from it, which is the asymmetry the depth of field inherits. Every disc is centred on the mark a pinhole at the pupil's centre would have made — worst departure 1.5e-17 millimetres across all seven, which is the floor of the arithmetic rather than a tolerance. The number over each disc is its diameter in the pixels of this collection's figures.6.80.9 m3.31.4 m1.22.1 m0.03.0 m0.94.4 m1.77.0 m2.416.0 mf/5.6, focused at 3 mcentres to 1.5e-17 mm
Fig. 6 The patch shrinking with the pupil, which is the same statement seen as a picture: the disc is the hole.

What is licensed, precisely

Worth stating as a list, because “the geometry survives” is a large claim and it is not unlimited.

Licensed: the position of the centroid of a point’s image; every construction built on centroids; vanishing points, horizons, cross-ratios, homographies, recovered focal lengths and recovered poses, at any aperture and any degree of defocus.

Not licensed: anything that reads an edge rather than a centroid. An occluding edge does not blur symmetrically, and its position in a defocused picture is not where a pinhole would have put it — which is a pupil sees around an edge, and it is the one thing in this row that does not survive.

And not licensed: any assumption that the blurred picture is a function of the sharp one. Two scenes with identical pinhole pictures can have different pupil pictures, which is the same essay’s stronger result.

So the licence covers point features and stops at silhouettes, which is a boundary a practitioner can use: a calibration target of dots is safe out of focus and a calibration target of checkers is not. That is a sharper statement of the same caution the eye is a place, not a point raises about where a camera’s centre actually is, and it is worth putting beside one depth per sample is not enough, where the same failure appears in a renderer.

A pupil reaches 120 mm behind the edge that a pinhole cannot see pastA plan of the object side of a 85 mm lens at f/1.4. The pupil is on the left, an opaque edge stands 1.2 metres away, and the background is at the focus distance of 6 metres. Five rays leave one point of the sensor and fan out across the pupil; the ones drawn faint are stopped by the edge, and the ones drawn solid get past it and land on the background behind the edge — as far as 120 millimetres behind it, which is R(Z₂/Z₁ − 1) and comes out at 121. A pinhole at the pupil's centre receives the middle ray only, so everything in that strip is, to a pinhole, absent. **The scene behind an edge is in the photograph and not in the pinhole picture of it.** The axis is compressed; the vertical scale is millimetres of the scene.the pupilan opaque edge120 mmf/1.4, focused at 6 m3 of 5 rays get past
Fig. 7 Where the licence stops: rays getting past an edge that a pinhole cannot see around.

Where the disc’s size becomes a decision

The size is a number and nothing about it says whether a picture is sharp, which is the subject of the next rung and worth a sentence here because it is the commonest confusion about the whole topic.

There is no aperture at which a picture becomes sharp. There is a diameter of disc that a particular reader, at a particular viewing distance, looking at a particular print size, is prepared to ignore — and every quantity usually quoted about depth of field is that acceptance restated in metres. The sharp band is a decision measures the whole family of them on one lens at one focus setting, and the band goes from half a metre deep to unbounded without anything about the optics changing.

Quoting the criterion in pixels of the picture rather than in millimetres of sensor is this collection’s own choice and it is deliberate: a circle of confusion in millimetres presupposes a print size and a viewing distance that are almost never stated, and this is a site that computes viewing distances.

What a pupil costs a measurement, in practice

One number, and it is smaller than the topic’s prominence suggests.

A mark located as the centroid of a blurred blob is located to roughly the blob’s diameter divided by the square root of the number of photons in it — which for an ordinary exposure is a fraction of a pixel even when the blob is thirteen pixels across. Defocus therefore loses less positional accuracy than intuition expects, and a calibration target photographed slightly out of focus is often located better than one photographed sharply, because a larger blob has more pixels to average.

What defocus destroys is not position but discrimination: two nearby marks merge, an edge stops being a step, texture disappears. So the practical failure of a defocused calibration is not that the marks move, but that fewer of them can be found and told apart.

That is worth stating because it is the reverse of the usual advice, and because it follows directly from the identity at the top of this essay. If the centre of the disc were biased, defocus would introduce a systematic error that no amount of averaging removes; because it is not, defocus introduces only a variance that averaging does remove.

The sampling behind the number

The centre is computed as the mean of sixty-four landings around the pupil’s rim rather than from the chief ray, and the distinction is the whole reason the measurement is a measurement.

Taking the chief ray and calling it the centre would assume what is being shown. Taking the mean over the rim of a symmetric pupil gives the same answer for a reason — the rim is symmetric about the axis, and the map from pupil position to sensor position is affine at a fixed depth — and the agreement to 5.7 × 10⁻¹⁴ millimetres is that reason confirmed rather than restated.

The same sampling reports one more thing the closed form cannot: the patch’s roundness, the spread of its rim radii about their own mean, which comes back at 5.9 × 10⁻¹⁵. A patch that was slightly elliptical on the axis would have said the projection was not what it was thought to be, and nothing else would have noticed.

The short version

Give the centre of projection an area and every world point images as a disc of radius R|1 − v₀/v|, whose centre is the pinhole’s mark to 5.7 × 10⁻¹⁴ millimetres at every aperture, distance and field position. The identity follows from the pupil’s symmetry rather than from the algebra, and moving the pupil off the axis moves the mark by 0.106 millimetres.

So a finite aperture spends sharpness and buys nothing and costs no geometry — for point features. The exception is an edge, and it is large.

Seven distances, seven discs, every centre on the pinhole's mark to 5.9e-17 mmThe patch a point on the axis images as, at seven distances from 0.9 to 16 metres, drawn to a scale that is the same at every aperture. The lens is focused at 3 metres, where the patch collapses to a point; either side of it the disc grows, and it grows faster toward the camera than away from it, which is the asymmetry the depth of field inherits. Every disc is centred on the mark a pinhole at the pupil's centre would have made — worst departure 5.9e-17 millimetres across all seven, which is the floor of the arithmetic rather than a tolerance. The number over each disc is its diameter in the pixels of this collection's figures.27.10.9 m13.31.4 m5.02.1 m0.03.0 m3.74.4 m6.67.0 m9.416.0 mf/1.4, focused at 3 mcentres to 5.9e-17 mm
Fig. 8 The same seven distances at f/1.4, where the discs are four times the area and the centres have not moved.

What links here

Computed from the collection, not written here: the essays that point at this one.

Reads more easily once this is understood

Essays that name this one as worth reading first.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A flat tag is an object no other essay names yet.

Aperturecentre of projectionChief rayCircle of confusiondepth of fieldEntrance pupilExit pupilFocal lengthinstrument limitPinholePoint spread functionSensorThin lensVignetting