Invisible CenterFR EN IT ES
Atelier IMAGE4D

Invisible Center

The camera that knows itself
Early metric camera

Albrecht Meydenbauer's metric camera, c. 1898.
Photograph Simon Schmid, Swiss National Library, CC BY-SA 3.0, cropped.

This instrument is a hundred and fifty years old. With it and a few of its kind, cathedrals were surveyed to the centimetre, without scaffolding, without electronics, without a single line of software. Hence the question underlying everything that follows: how is it even possible to measure with a photograph?

The answer fits in three chapters. What the camera must know about itself. What happens when it is wrong. How we recover what it no longer knows.

Chapter 1

The chamber

Here are f, cx, cy

Every photograph that claims to measure the world rests first on three numbers nobody looks at: a distance, f, and a point, (cx, cy). The full model of interior orientation has more, distortion first among them; these three are the bedrock, and they will be enough here. No data sheet gives them, and without them an image is only an image.

Before photographing anything, let us look at the instrument. A camera, reduced to what matters for measurement: a point, a plane, a distance.

Chambre métrique ancienne, tirants diagonaux visibles
drag to rotate
Calibration in steel.

u = f · X / Z + cx     v = f · Y / Z + cy three numbers are enough to say where the world lands on the image X, Y, Z are taken in the camera frame; bringing the world into it will be the business of exterior orientation, in chapter 3
Why f in pixels?

Focal length is usually given in millimetres: a 50 mm lens. But in a digital image the natural ruler is the pixel, and one converts through the pixel size: f (pixels) = f (mm) / pixel pitch (mm). A phone module, 5.6 mm of focal length and 1.4 µm pixels, gives f = 4000 pixels. That is the unit for everything that follows: it says how many pixels from C the image plane sits, and it lets an error in cx, itself in pixels, be compared directly to f.

Chapter 2

A few pixels

What happens when the camera is wrong about itself

A camera measures nothing as long as it ignores itself. And ours ignores itself: every act of focusing moves f, whether a ring turns or a motor does the work; stabilisation moves the principal point at every frame; the firmware corrects distortion without saying so. No data sheet will give you cx, cy.

Below, a photograph is reprojected onto the geometry of a building corner. The edges and the white frames are the geometry: they do not move. Shift the principal point of the camera that took the view, by a few pixels only.

Deviation 0.00°
i.e. 0 mm at 4 m  ·  0 mm at 5.4 m

The stone slides under the windows. And because the two walls are not at the same depth, the error is not the same everywhere: the image shears along the edge. On the image, a few pixels; extended as rays to the building, they become metric errors that grow with distance: centimetres on the monument. The fiducial crosses, for their part, do not move: they belong to the frame.

For the connoisseurs: cx and rotation

A shift of cx moves every pixel by the same step. A small rotation of the camera about its optical centre does almost the same, and, against intuition, with no regard for depth: it moves pixels according to their position in the field: at the centre, by the same step as a cx shift; towards the edges, more. Near the axis the two are therefore almost indistinguishable; it is the edges of a wide field that separate them. Relief separates something else: cx from a lateral translation, whose effect decreases with distance; and it defuses the degeneracies that lie in wait for planar scenes. A flat target is in fact not bad in itself, it is risky: what makes for poor conditioning is poor geometry or degenerate motions, orientations too alike, a field badly covered; relief is simply the safest safeguard, hence photogrammetrists' taste for three-dimensional target fields. Wide field, points out to the edges, a world in relief: that is the specification of a good calibration. As for the next chapter's algorithm, it will walk rather than jump for a simpler reason, the nonlinearity the rotations bring; but if it walks slowly, it will be because of this kinship of cx with them.

What steel guaranteed once and for all must now be estimated. But estimated from what?

Chapter 3

Finding the camera

If f, cx and cy are unknown, how do we find them?

The chamber of old knew itself because it had been built. Ours is an unknown. But it has photographed the same building from six viewpoints, and the building does not lie.

Surveyors distinguish interior orientation, f, cx, cy, what the camera is, from exterior orientation, where it stands and where it looks. In our setup the building is known and so are the positions of the six stations; all that remains uncertain, for each station, is the aiming direction, reduced to one angle: its rotation about the vertical, the yaw. Nine unknowns, then, three interior and six angles, one per station: a workshop choice, the general case has far more, as we will say under the hood.

Each window corner observed in several images defines rays that should all pass through a point we know: that very corner, since the building is surveyed. If the interior orientation is wrong, or the aims inexact, the rays miss the point, and miss one another. Calibration seeks, in a single motion, the interior and the exterior that bring them all back at once: here it must, since the aims are unknown; and it almost always must in practice, for an image mixes what the camera is with where it looks.

f (px)cxcy
estimated ? ? ?
Reprojection error (rms)  ·  iteration 0
pace 0.8 s / iteration

The facades, the six cameras, and the rays of the tracked point, drawn with the estimated camera; the loupe shows the known point they should all pass through. Press Calibrate: a real minimisation runs, step by step, over nine unknowns, three of interior orientation and six of exterior orientation. The log shows the unknowns correcting themselves iteration after iteration, including the steps the algorithm rejects, and the cameras can be seen re-aiming as it goes. The cloud of residuals tightens down to the circle of the measurement noise, then stops there: there is no exact result, only acceptable residuals.

Iteration log

rms convergence (log scale)

Reprojection residuals

frame ±– pxnoise σ = 0.3 px
Under the hood: the optimisation

A true camera is hidden in the page, deliberately off-centre, and the six true aims are skewed by a few degrees. The observations are manufactured by projecting the building's points through this camera, with Gaussian measurement noise, independent from one observation to the next, of standard deviation 0.3 pixel on each coordinate. The estimation starts from a wrong camera and from aims assumed perfect, then minimises, by Levenberg-Marquardt, the reprojection error: for each window corner in each image, the discrepancy in pixels, on the plate, between the observed point and the point projected by the estimated camera. It is this criterion, and it alone, that the algorithm drives down, summarised in one number, the rms, the root mean square: the square root of the mean of the squares of all these discrepancies, in pixels. The rays converging in the loupe are its geometric image, not the quantity being minimised. Nine unknowns: f, cx, cy, and for each station a single aiming angle, the yaw, the other components of the orientation being held exact. This count of nine belongs to our setup, where the building plays the role of a known target and the station positions are held exact; in the general case, each image brings six pose unknowns, each world point three more, and bundle adjustment estimates them all together. The simplification changes the count, not the nature of the problem. A detail that matters: with the exterior orientation perfectly known, the problem would be linear and would be solved in a single jump. But this textbook case is hardly met outside the laboratory: there are calibration benches where the stations are measured by theodolite, banks of collimators whose directions are known by construction; even there, known means measured, with its own uncertainty. Everywhere else, interior orientation is observable only through images, and an image always entangles the interior and the exterior. It is this joint estimation that makes calibration genuinely iterative, and that creates its classic difficulty: a small shift of cx looks very much like a small rotation. What separates them is not depth, a rotation about the optical centre moves pixels with no regard for it, but the edges of the field: rotation moves them more there, cx everywhere by the same step; a wide field is needed, with points out to the edges. If it walks instead of jumping, it is first, quite simply, because the rotations make the problem nonlinear and the Jacobian changes at every step; if it walks slowly along cx, it is this kinship with the rotations, a narrow valley that only the edges of the field straighten. Nor do the nine unknowns share the same status: the six aims are auxiliaries, estimated and then left behind with the stations; the three interior parameters are the durable product of the computation, the camera's identity card, reusable tomorrow, elsewhere, on other poses. One last word: to calibrate, in the metrologist's sense, is to learn what an instrument is, without altering it; adjusting it would be another matter. That is the sense we keep. A final subtlety, which the final table shows by itself: the rms of the residuals settles in the neighbourhood of the noise's standard deviation, a breath below it even, the adjustment having absorbed its nine degrees of freedom; there is nothing down there to go looking for. The parameters, however, can be estimated more finely than the noise of a single measurement, for each observation brings its grain of information; the uncertainty decreases roughly as the inverse square root of the number of observations, as long as the errors remain independent; then come the floors that nothing averages away, the geometry and its correlations, that of cx with the rotations first among them, and the flaws of the model itself. Noise averages out, bias repeats. And so the last word keeps its exact meaning: we never know better than what we have measured, not each measurement taken alone, but the sum of information of all of them together.

Geometry, error, observations, estimation, geometry recovered. The loop is closed. Steel fixed the interior orientation so that only the exterior remained to be measured in the field; we now estimate both, together, in the same computation. But only the interior comes out of it: the aims are consumed on the spot, while the calibration travels; it will say tomorrow, on other images, what this camera is, as long as nothing moves inside the box. This is the geometry that the tie rods, the frame and the fiducial marks once made materially stable.

We never know better than what we have measured.