The rectangle behind the lens

The pixel that is not square

A camera with two focal lengths is a real thing — anamorphic cinema optics, non-square photosites, a stretched video format. Hand this site's own round trip a picture from one and it returns a focal length 49.6% out, a principal point far from the truth, three independent estimates agreeing to 1e-16, and bundle residuals at the noise floor. Every alarm the site has stays silent.
17 min read 9 figures The round tripFitted, not assumed

Worth reading first: A focal length is not an angle · Recovering the camera from the picture it drew.

Everything on this site so far has assumed one focal length. The site’s camera takes a single focal length, the recovery returns a single number, and the round trip compares one against one. That assumption is so uniform that it has never been stated as an assumption.

It is one, and it is false of several real cameras. Anamorphic cinema optics squeeze the image horizontally on the way onto the film and unsqueeze it on the way out. A sensor whose photosites are wider than they are tall does the same with no optics at all. Several video formats have carried non-square pixels since they were defined.

Every one of those is a camera with two focal lengths — fxfyf_x \ne f_y — and it is a perfectly ordinary projective camera. The picture it makes is not distorted in any sense this site uses the word: straight lines are straight, cross-ratios survive, vanishing points converge exactly. It is a pinhole picture with one axis scaled.

Squeeze the pixels and every alarm this site has stays silentThe same box, drawn by a camera whose pixels are 2.00 times wider than they are tall. The recovery is shown the drawn edges and nothing else; it returns a focal length of 219.9 px against a true 436.4, a principal point 48.1 px away — and a spread across its three independent estimates of 0.0e+0, with bundle residuals of 9.1e-13 px.pixels 2.00 : 1recovered focal length219.9 pxthe camera's actual one436.4 pxwhat the recovery returnsspread across three estimates 0.0e+0worst bundle residual 9.1e-13 pxboth are what a wrong picture would trippixel aspect 2.00 unmodelledfocal length 49.6% short, every diagnostic clean
Fig. 1 The same box, drawn with pixels twice as wide as they are tall, with the square-pixel version behind it. The recovery is shown the drawn edges and nothing else. It returns 219.9 px against the camera’s own 436.4 — 49.6% out — with a spread across its three independent estimates of 0.0e+0 and a worst bundle residual of 9.1e-13 px.

What the recovery has to work with

The site’s round trip is three equations. Three mutually orthogonal world directions have three vanishing points; each pair of them gives one equation of the form (vip)(vjp)=f2(v_i - p)\cdot(v_j - p) = -f^2; and the three together determine the principal point pp (as the orthocentre of the triangle) and the focal length ff.

Three equations, three unknowns — pxp_x, pyp_y, ff — and the system is exactly determined.

A camera with two focal lengths has four unknowns. Three equations cannot find four numbers, so something has to give, and the whole interest of this essay is in which thing gives and what the machinery says about it while it happens.

What actually gives

Run the box through a camera with a squeeze of 2 and hand the drawn edges to the recovery:

true recovered
focal length 898.8 px 453.0 px
principal point (345.0, 210.0) (345.0, 52.1)
spread across three focal estimates 0.0e+0
worst bundle residual 6.3 × 10⁻¹³ px

The horizontal component of the principal point is exactly right, because the squeeze was about it. The vertical component has moved 158 px. The focal length is roughly halved, though not exactly — the squeeze is absorbed by the focal length and the principal point together, in a proportion the geometry decides rather than by a rule anybody would guess.

And the two quantities the site relies on to report trouble both report nothing.

The two alarms, and why they are silent

This is the part worth taking slowly, because both alarms were built deliberately and each is a good alarm.

The spread. recoverCamera computes the focal length three times, once from each pair of vanishing points, and returns their spread rather than averaging them away. Its own comment says why: “a construction that is not a projection of a rectangular box gives three different answers, and the spread is how far from being a box it is.” That is the check the wrong field is built on — it is what says a hand-drawn cube is not one.

Here the spread is 0.0×1000.0 \times 10^{0}. The three estimates are identical.

The residual. The vanishing-point fit takes a bundle of drawn segments by least squares and returns the worst distance from the fitted point to any of the lines. A bundle that is not really concurrent has a large residual, and that residual is what separates a real projection from a plausible drawing.

Here it is 6.3×10136.3 \times 10^{-13} px. The edges really are concurrent.

Neither is malfunctioning. The squeezed picture genuinely is a perfect projection of a rectangular box — by a camera with square pixels, a focal length of 453 px and a principal point 158 px above where the renderer put it. That camera exists, it is consistent, and it reproduces every drawn mark exactly. The recovery found it and was right about it.

A box drawn from a known camera, and the camera recovered from the drawingThree vanishing points found from the twelve drawn edges alone give back the focal length to 2e-15 relative.recovered principal pointused to drawrecoveredgapfocal length707.35707.352e-15principal x345.0345.02e-12angle52.0°52.0°correct from 16 cm, at 160 mm wide52° across
Fig. 2 The recovery working correctly, on a picture it can answer. Three bundles, three vanishing points, one focal length and one principal point — with the three estimates agreeing because the picture really was made by a square-pixel camera. The identical output shape is what makes the squeezed case dangerous: nothing about the answer says which of the two it is.

The shape this phase keeps meeting

The recovering phase’s own recurring finding was that four distinct failure modes in multi-view geometry all return a confident wrong answer with a small residual. This is the same shape, in one view, and it is the sharpest instance the site has.

It is worth naming exactly what makes it sharp. In the multi-view cases the residual is small; here it is at the noise floor. In those cases some diagnostic usually flickers; here every diagnostic the site owns is not merely quiet but at its theoretical best. There is no number to look at, anywhere in the machinery, that distinguishes the two cases.

The reason is structural rather than unlucky. A fit with fewer equations than unknowns does not produce a residual — it produces a family of solutions and picks one, and the picked one fits perfectly by construction. Residuals report over-determination failing; they say nothing about under-determination. That is a general fact about fitting and it is worth stating plainly, because “the residual was small so the answer was right” is an inference people make constantly and it is only valid when there were spare equations.

6 pictures, 168 parameters, and seven of them freeThe smallest 16 singular values of the reprojection Jacobian, as fractions of the largest. Seven sit at below 10⁻⁸ and the eighth jumps to 1.3e-2 — a factor of 4.6e+6. Those seven are where the reconstruction is, how it is turned and how big it is: three, three and one. No number of further pictures removes any of them.× 4.6e+6seven flatand the rest stiffsingular value ÷ the largest, log scale, smallest firstσ₈/σ₇ = 4.6e+6168 parameters · 528 residuals
Fig. 3 The many-view version of the same statement, from the manyviews field. Seven directions in parameter space along which a reconstruction can be moved with no cost at all, found as the flat directions of a Jacobian. A flat direction is exactly an unknown the data cannot see, and moving along it changes the answer without changing any residual anywhere.

What would detect it

Three things would, and it is worth saying what each needs, because the list is short and every item costs something the single view does not have.

A fourth constraint. A fourth direction known to be orthogonal to the others is impossible in three dimensions, but a known angle between two directions, or a known length ratio in the scene, adds an equation and makes the system determined. That is a scene assumption — the picture does not supply it.

A circle. A circle in a world plane images as an ellipse under a square-pixel camera, and the ellipse’s axes are constrained; under a squeeze the constraint is violated in a way that is detectable. This is close to what the foundations field measures about a projected circle, and it needs the scene to contain a circle known to be one.

A second view. Two views of a rigid scene over-determine the intrinsics, and the squeeze then shows up in the residual. Which is what a second picture buys, in its most concrete form: not shape, not size, but the ability of a fit to fail.

Each of those is the same purchase in a different currency. What is missing is not precision — the numbers here are exact to the last bit — it is redundancy, and redundancy is the only thing that lets a wrong model announce itself.

A circle on the ground, and the two points that get called its centreThe image of the centre and the centre of the image ellipse are 21.1px apart — 5.1% of the ellipse's own width.centre of the ellipseimage of the centrecorrect from 22 cm, at 160 mm wideoffset 21.1 px
Fig. 4 The constraint a circle would supply. A circle in a world plane images as an ellipse whose centre is not the image of the circle’s centre, and the offset is computable from the camera. A squeeze alters the ellipse in a way that no square-pixel camera can produce — but only because the scene was known to contain a circle.

Why the squeeze lands where it does

The table above says the focal length is roughly halved and the principal point moves 158 px vertically. Neither is obvious in advance and it is worth working out where they come from, because the split between the two is the interesting part.

A horizontal squeeze by aa about the picture’s vertical centre line moves every vanishing point toward that line by the factor aa and leaves its height alone. So the triangle of three vanishing points is compressed horizontally and not vertically.

The principal point is the orthocentre of that triangle. An orthocentre does not transform with the triangle under a non-uniform scaling — that is precisely what “non-uniform” costs — so it moves, and it moves in the direction the squeeze did not act. Hence a vertical displacement from a horizontal squeeze, which reads backwards until the mechanism is written down.

The focal length then comes out of the dot products taken about the moved orthocentre, so it absorbs both the compression and the displacement together. That is why 898.8 goes to 453.0 rather than to exactly half of 898.8: the squeeze is 2, but part of it has been spent moving the principal point.

The split between the two is decided by the triangle’s shape, which is decided by the camera’s orientation relative to the box. So the same squeeze on the same camera pointed differently gives a different split — a different focal length and a different principal-point displacement, both wrong, both self-consistent. There is no fixed correction factor to be had, which is the practical form of the whole finding.

The three vanishing points of one box, drawn to scale with the boxThe picture is the small rectangle. Two of the three vanishing points fall well outside it, which is why they are computed rather than located by eye.the pictureVP₁VP₂VP₃orthocentrefocal length from the triangle — 707.4 pxspread 0e+0% across three routes
Fig. 5 The triangle the squeeze deforms. Its orthocentre is the principal point and the three dot products taken about it are the focal length, so compressing the triangle in one direction moves the orthocentre in the other and spends part of the squeeze on the principal point. How much depends on the triangle’s shape, and its shape depends on where the camera was pointing.

The convention that makes this benign in practice

A note in the other direction, because the essay would be misleading without it.

In practice a pixel aspect ratio is declared. Every camera calibration in real use fits fxf_x and fyf_y separately from a target with many known points, which supplies far more equations than unknowns and determines both. Video formats with non-square pixels carry the ratio in their metadata. Anamorphic optics have a stated squeeze factor and the unsqueeze is applied before anything else looks at the picture.

So the failure this essay measures is not one that happens to careful people using calibrated equipment. It happens when a picture arrives without its metadata, when a still is grabbed from a stretched video, when an image is resized non-uniformly somewhere in a pipeline, or when a measurement is made from a frame nobody calibrated.

Which is exactly the situation single-view metrology is usually in. Reading a height from a photograph is a technique for pictures that were not taken for the purpose, by cameras nobody has, under conditions nobody recorded — and it is the situation in which the assumption of square pixels is both necessary and unverifiable.

What one pixel of click error costs, against the object's own heightAt a fixed distance the error per pixel FALLS as the object gets taller — from 5.74% for a 0.4 m post to 0.100% for a 30 m one. The instability the formula appears to have is not there.0246102030height of the object (metres)error in the recovered height, per pixel of click error (%)1 m tall — 2.31%5 m tall — 0.48%15 m tall — 0.18%30 m tall — 0.10%one pixel, on a 690 px picturethe expected instability is absent
Fig. 6 The setting where the assumption is unverifiable and load-bearing. Single-view metrology reads a scene out of a picture nobody took for the purpose, so its sensitivity to the intrinsics is the whole subject — and an unmodelled squeeze is a systematic error in the intrinsics that no repetition and no averaging will reveal.

The fifth parameter nobody fits

There is a fifth intrinsic parameter that this essay’s arithmetic quietly assumes away, and it is worth naming because it is the one place the analogy with real calibration breaks.

A general intrinsic matrix has a skew term as well as two focal lengths and two principal-point coordinates — the entry that appears when the sensor’s rows and columns are not perpendicular. Five parameters, and the three-equation recovery is short by two rather than by one.

In practice skew is fitted as zero by essentially everybody, and for a good reason: a sensor whose photosite grid is not rectangular is a manufacturing defect rather than a design, and measured values come out at 10410^{-4} of the focal length or smaller. It is the one intrinsic parameter that is genuinely negligible.

But its being negligible is a fact about how sensors are made, not a consequence of anything geometric — and it is worth saying so, because “skew is zero” is usually presented as though it were a property of cameras rather than of factories. An anamorphic lens whose squeeze axis is not aligned with the sensor’s rows produces exactly a skew, and it is not small.

So the honest count is: five intrinsic parameters, three equations from one view of a box, and two assumptions doing the work. This essay measures what happens when one of the two is wrong. The other, being wrong far less often, has never been tested here — which is a shortfall recorded rather than a gap papered over.

The cost of assuming the principal pointThe two-vanishing-point route to a focal length needs a principal point supplied, and every textbook supplies the middle of the frame. On a shifted or cropped picture that is wrong, and f² = −(v₁ − p)·(v₂ − p) turns the error into a product of two large numbers: 3.2% at 150 px of shift. The three-point recovery does not assume it and has no such error.0123050100150how far the principal point really is from the middle of the frame (px)error in the focal length, from assuming it is not (%)unshifted: the assumption is truea 60° lens3.20% at 150 px of shift
Fig. 7 The general shape of assuming a parameter rather than fitting it, from the lens field. What an assumed principal point costs the recovered focal length, against field of view. Every assumed intrinsic behaves this way: the error does not disappear, it is absorbed by whatever is being fitted, and the fit reports no difficulty.

The one cue that would give it away

Having said that no quantity computable from the picture distinguishes the two cameras, it is worth conceding the one thing that does — because the concession sharpens what the claim actually is.

A viewer looking at a squeezed picture of a familiar object sees a squeezed familiar object. Faces are the extreme case: a 5% horizontal squeeze on a face is noticeable to almost anybody, which is a far finer discrimination than any of this essay’s numbers.

That is not a counter-example to the claim. The viewer is supplying an external fact — that faces have a known shape — which is exactly the fourth constraint the recovery lacked. Every one of the three detectors listed above is a way of supplying such a fact mechanically, and a viewer’s familiarity with faces is the same purchase made by a route the machinery does not have.

Which is the site’s usual boundary, met from an unusual side. The geometry says what the picture contains; a viewer regularly knows more than the picture contains, and the extra is where the discrimination comes from. It is worth being precise that the extra is knowledge about the scene rather than sharper looking at the picture.

The honest statement of the limit

Stated as carefully as the site can:

A single view of a rectangular box, with no scene knowledge beyond the orthogonality of its three edge directions, determines three camera parameters and cannot determine four. If the camera has four, the recovery returns a three-parameter camera that reproduces the picture exactly, and no quantity computable from the picture distinguishes the two.

That is a statement about information rather than about method. A better solver does not help. More careful drawing does not help. Any procedure whatever, applied to that picture, faces the same shortfall, because the shortfall is in the picture.

It is the same form as the site’s oldest limit — one view gives ratios and no size — and it is worth adding to the list rather than treating as a special case. Both are statements that a picture is a record of a pencil of rays, and that anything not determined by that pencil is not in there to be found.

Squeeze the pixels and every alarm this site has stays silentThe same box, drawn by a camera whose pixels are 1.33 times wider than they are tall. The recovery is shown the drawn edges and nothing else; it returns a focal length of 329.6 px against a true 436.4, a principal point 27.9 px away — and a spread across its three independent estimates of 1.7e-16, with bundle residuals of 3.4e-13 px.pixels 1.33 : 1recovered focal length329.6 pxthe camera's actual one436.4 pxwhat the recovery returnsspread across three estimates 1.7e-16worst bundle residual 3.4e-13 pxboth are what a wrong picture would trippixel aspect 1.33 unmodelledfocal length 24.5% short, every diagnostic clean
Fig. 8 And a modest squeeze, which is the dangerous size. At 1.33 : 1 the picture looks entirely unremarkable, the recovered focal length is 24.5% out, and the spread and the residual are exactly as silent as they are at 2 : 1. There is no aspect ratio small enough to be safe and large enough to be visible.
Two scenes 137× apart, and the one picture they both makeEverything in the second plan — the room, the eye's distance, the eye's own height — is 137 times the first. Every projected vertex agrees to 1e-13 px. A single photograph has no scale, and this is what that means.a room 2.8 m across, eye 1.6 m up1 mthe same plan, 137× bigger137 midenticalpicturesthe picture — both scenes, drawn twice, one on top of the otherlargest disagreement 1e-13 px over 8 verticesone length has to come from outside the picture
Fig. 9 The family this belongs to. A single view cannot supply a size, and no amount of looking at it changes that — the same picture is consistent with a scene at any scale whatever. The pixel aspect is the same kind of gap one dimension over, and its distinctive feature is that the site’s own alarms, which do fire for a bad drawing, cannot fire for a missing parameter.

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.

AnisotropyAspect ratioCamera calibrationCamera matrixDegeneracyDemonstrationFocal lengthnecessary, not sufficientPrincipal pointResidual