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.
Two rectangles need no assumption at all
The assumption is unavoidable with one rectangle and avoidable with two, and the construction is a pair of compasses.
The arc is the circle having the rectangle’s two vanishing points as a diameter: the locus of eyes, folded into the picture, that see those two directions at a right angle. A second rectangle lying at a different angle on the same floor has its own two vanishing points on the same horizon, and its own circle.
The camera’s eye is on both. So it is at one of the two points where the circles cross — and the one above the horizon is the station.
Counting confirms it. For a level camera the principal point lies on the horizon, so there are two unknowns: where along the horizon, and the focal length. Each rectangle supplies the one equation , so two rectangles are exactly enough, and the intersection of two circles is that pair of equations solved with a straightedge and compasses instead of algebra. A third rectangle over-determines it and gives a residual, which is a check rather than an improvement.
That changes what a photograph of a room is worth. A rug at one angle and a table at another; the floor lines of two walls meeting at a corner; a door and a window in the same wall. Any two rectangles whose edge directions differ, and the principal point stops being assumed. The photograph calibrates itself, which is the same service three perpendicular directions perform in a scene with a box in it, done here with two flat objects and no box at all.
The conditioning is visible in the construction, which is its own recommendation. Two circles cross sharply when they cross at a large angle and poorly when they are nearly tangent — and they are nearly tangent when the two rectangles lie at nearly the same angle on the floor, because then their vanishing points nearly coincide and their diameters nearly do too. So:
Two rectangles turned well apart give a sharp station; two nearly aligned give almost nothing. Two parallel rugs are one rectangle, which is the degenerate case arrived at continuously — the second circle collapses onto the first and the intersection becomes the whole arc again.
That is the same shape of statement perpendicular is a pairing makes about which pairs of directions carry a constraint, and it converts the essay’s finding into a piece of practical advice. Faced with a photograph and a proportion to recover, do not improve the assumption about the centre — find a second rectangle at a different angle, and the assumption is not needed. It is the cheapest of the closures this collection prices, because unlike a scale bar or a known height it requires nothing to have been brought to the scene, and it is one of the five facts that close the same gap with the peculiarity that the photograph usually already contains it.
The residual limitation is worth stating so the claim is not read as larger than it is. Two rectangles fix the eye for a level camera. A tilted one puts the principal point off the horizon and restores a third unknown, so three rectangles are needed — or two rectangles and the vertical vanishing point, which a tilted photograph of a room supplies for free. And every one of these routes assumes the drawn quadrilaterals really are images of rectangles, which is the assumption the next rung tests rather than one it can remove.
One more consequence, because it changes what “a few per cent” means. The single-rectangle error is a bias shared by every rectangle in a photograph taken with the same camera, since they all inherit the same wrong principal point. So a reader comparing two rugs in one picture gets their ratio far better than either proportion — the common factor divides out — while a reader comparing a rug in one photograph with a rug in another gets neither the proportions nor the comparison, because the two cameras’ principal points are independently wrong. Within one photograph the assumption is nearly free; across two it is the whole error, which is the opposite of how a per-cent figure is normally read.
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.
- The quadrilateral no rectangle casts
- Perpendicular is a pairing
- The hook is the centre, and the eye is not
- A tilted sensor is not a distortion
- The slip that leaves no trace
- Four marks before anything is said
- One pass reads the road's slope as well as its spring; a second speed only doubles the road
- The circle in the square wants a number
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- The response is at the ends and the information is not — both name camera calibration, conditioning, demonstration, error propagation, principal point
- A known target sharpens the fit and does not separate it — both name camera calibration, conditioning, error propagation, principal point
- 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
- A square plan is not a cube — both name depicted rectangle, focal recovery, free parameter, station point
- No design separates the two coefficients — both name camera calibration, conditioning, error propagation, principal point
Named objects
A flat tag is an object no other essay names yet.
Camera calibrationConditioningCrop factorDemonstrationDepicted rectangleerror propagationFocal recoveryFree parameterLens shiftPrincipal pointStation point