The proportion is the assumption
Worth reading first: The arc every eye stands on · The principal point is not the centre · The point you have to stand at.
Somebody photographs a rug on a floor and wants to know its proportions. This is a completely ordinary thing to want, it is done constantly, and the machinery for it is four drawn corners and a formula.
The formula needs one number the photograph does not contain, and this essay is about what supplying it wrongly costs.
What is being assumed
The arc every eye stands on sets it out: four corners give two vanishing points and one equation, and the equation has three unknowns in it. Two of them are the coordinates of the principal point — the foot of the perpendicular from the eye to the picture plane — and everybody assumes it is the middle of the frame.
The assumption is not stupid. A camera whose sensor is centred behind its lens has its principal point at the centre of the frame, and most cameras are built that way to within a per cent or so.
It is also not free, and this site has already priced the ways it fails.
The sweep, and what it is not
The plot above is a sweep of the whole arc, from just inside one vanishing point to just inside the other. That is not a range of plausible assumptions — nobody thinks the centre of the picture is out at a vanishing point — and reading it as an error bar would be a misuse of it.
What it is, is the shape of the dependence. Two things about that shape matter.
It is monotone. Sliding the assumed centre one way always makes the reconstruction longer in one direction. So an error in the assumed centre is a bias in the recovered proportion, with a sign, rather than a scatter — and averaging over many photographs will not remove it if they share a camera.
And its slope is not uniform. The curve is shallow in the middle and steep near the ends, so how much a given error in the assumed centre costs depends entirely on where along the arc the picture falls.
The realistic version
Restricted to the range a real camera’s principal point actually occupies — a few per cent of the frame width off centre, which covers an ordinary lens, a modest shift and a crop — the numbers come down to something a person would care about rather than something that makes the exercise look hopeless.
A few per cent of the frame width, on the sweep above, moves the recovered proportion by several per cent. Which means: a proportion read off a photograph of a rectangle is good to a few per cent and not better, unless the principal point has been established some other way.
That is a useful number and it is worth putting beside the ones this site has measured elsewhere. How wrong a measurement from one picture can be prices the height-from-a-photograph route the same way, and finds the same shape of answer: exact geometry, an assumption in the middle of it, and an error set by the assumption rather than by the arithmetic.
Why this is not an argument against the method
There is a reading of the sweep that would be wrong, and it is worth heading off.
The plot runs over a factor of nearly sixteen, which looks catastrophic. It is not, because the sweep covers the whole arc and the arc’s ends are stations nobody would propose. At one end the eye is nearly on the horizon, which is a camera looking exactly along one of the rectangle’s edges from ground level; at the other it is nearly on the other vanishing point. Neither is a photograph anybody takes, and the reconstructions there are extreme because the stations are.
What the plot is for is the derivative at the middle, not the extremes at the ends. That is why the section above restricts to the range a real principal point occupies before quoting anything, and it is why the honest headline of this essay is “a few per cent” rather than “a factor of sixteen”.
What actually fixes it
Four things, in rough order of how likely a photograph is to contain them.
A second rectangle on the same plane, at a different angle. Two pairs of perpendicular directions determine the involution on the horizon, which determines both the focal length and where the centre is along it — with nothing assumed.
A vertical, which turns the problem into the three-direction recovery and over-determines the camera.
A known proportion somewhere in the scene — one square tile, one sheet of paper — which supplies the missing number directly.
Or a calibrated camera, which is what the whole business of camera calibration exists for and is the only one of the four that is a fact about the equipment rather than about the picture.
Which way the bias runs
A bias with a sign can be traced, and this one can be described without any arithmetic.
Assume the centre of the picture is too far toward one of the two vanishing points. The perpendicular from it meets the arc nearer that end, which means the station is being placed nearer that vanishing point — that is, the camera is being taken to have been more nearly along one of the rectangle’s two edge directions than it really was.
A camera more nearly along a direction sees that direction more foreshortened. So the reconstruction has to make the rectangle longer in that direction to account for the drawn extent, and the recovered proportion moves that way.
That gives the practical rule. An error in the assumed centre stretches the reconstructed rectangle along whichever edge direction the error moves toward, and a photographer who knows their lens is shifted knows which way their answers are wrong before computing anything.
The part that is easy to get backwards
The reconstruction is a genuine rectangle at every station, and that is worth dwelling on because it removes the obvious sanity check.
A reader who suspected the assumed centre was wrong might reasonably look for a symptom: corners that come out not-quite-square, edges that do not quite match. There is none. The focal length is chosen at each station precisely so that the two directions are perpendicular, so the reconstruction has right angles by construction — to the arithmetic floor, across the entire sweep.
So the wrongness is invisible in the reconstructed object. It shows up only against something outside the reconstruction — a second rectangle, a known length, a calibrated camera — which is the general shape of every under-determined problem and is why the arc had to be found before the sensitivity could be quoted.
What a crop does, which is not obvious
A crop moves the principal point relative to the frame without moving anything in the world, and the arithmetic notices.
Photograph a rug, crop the picture off-centre, and hand the crop to somebody. The rectangle’s four corners are unchanged in the world and their positions relative to the frame have moved. Assume the centre of the frame is the centre of the picture and the assumption is now wrong by exactly the crop.
That is worth flagging because a crop is invisible. Nothing in a cropped photograph says it was cropped, whereas a shifted lens leaves a signature — the verticals stay parallel while the composition is off-centre — and a tilt leaves a bigger one.
The rule that follows is a small piece of practice: measure from the original frame, not from a crop, and if only a crop is available, say so alongside the answer.
What this does not say
It says nothing about lens distortion. Every corner here is exactly projected; a real photograph’s corners have been moved by the lens before anything is fitted, and the two errors compound.
It says nothing about the four corners being read accurately. Every position here is exact to the last bit, and a real one is a click on a screen.
And it does not say the assumption is a bad one. It says the assumption is doing more work than it looks like it is doing, and that the answer should be quoted with it stated. A proportion reported as “1.62 : 1” is a claim; the same number reported as “1.62 : 1, assuming the principal point is the centre of the frame” is a measurement, and the difference costs eleven words.
Where this leaves the ordinary case
None of the above says that reading a rectangle out of a photograph is a bad idea. It is a good idea and it is what a single view is for. What the sweep supplies is the sentence that has to go with the answer.
Three practical statements come out of it, and they are all that is needed.
Report the assumption. A proportion recovered from four corners has a principal point in it, and naming it costs a clause.
Prefer the composition that is well conditioned. A rectangle near the middle of the frame, seen fairly square-on, sits at the shallow part of the curve. One at the edge, seen obliquely, sits at the steep part. That is a choice a photographer makes before pressing anything, and it is worth more than any amount of care afterwards.
And take the second rectangle when it is free. A floor with two differently oriented rugs on it, a room with two tables at different angles, a paving pattern that changes direction — any of them closes the family for nothing, and the resulting measurement has no assumption in it at all.
What a second photograph would do
The obvious suggestion, when one photograph is short of information, is to take another. It is worth saying what that does and does not buy here.
Two photographs of the same rectangle from two places give two arcs — but they are arcs in two different pictures, and they cannot simply be crossed. What two views do supply is the relative pose of the two cameras and the shape of the scene, up to scale, and that is enough to determine the rectangle’s proportion without any assumption about the centre of either picture.
So the second photograph is a stronger instrument than the second rectangle and a much larger piece of work. The second rectangle is free — it is already in the picture or it is not — and it closes exactly this gap; the second photograph needs correspondences and a pose recovery and gives back the whole scene.
Which is the right trade depends on what is wanted. For a proportion, the second rectangle. For a room, the second view.
The transferable form
When a measurement needs a quantity the data does not contain, the honest output is not a number but a function of that quantity — and its slope, not its range, is what the reader needs.
The whole sweep is not an error bar and it would be dishonest to present it as one. Its slope, at the point the assumption lands on, is the thing: it converts a per cent of uncertainty about the centre of a picture into a per cent of uncertainty about the answer, and it is different for every composition.
This site keeps arriving at the same shape. Depth is a reciprocal turns a fixed reading error into an interval that is not symmetric; a shadow across a second object has an amplification of one over a sine with no upper bound; and here a per cent of the frame becomes several per cent of the answer. Every one of them is exact geometry with a conditioning number in front of it, and every one of them is worthless quoted as a single figure.
What links here
Computed from the collection, not written here: the essays that point at this one.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- A picture with two eyes in it — both name demonstration, error propagation, free parameter, station point
- A projector is a camera run backwards — both name camera calibration, demonstration, depicted rectangle, focal recovery
- One conic calibrates the camera — both name camera calibration, demonstration, focal recovery, principal point
- Perpendicular is a pairing — both name camera calibration, demonstration, focal recovery, principal point
- The cube that is a box — both name depicted rectangle, focal recovery, free parameter, station point
- The marks name the place, not the height — both name conditioning, demonstration, free parameter, station point
Named objects
A flat tag is an object no other essay names yet.
Camera calibrationConditioningCrop factorDemonstrationDepicted rectangleerror propagationFocal recoveryFree parameterLens shiftPrincipal pointStation point