Concept

Camera calibration — where it appears

Finding a camera's focal length, principal point and distortion from pictures rather than from the manufacturer. On this site it is always done from a picture the site drew itself, so the recovered numbers can be differenced against the ones that made the picture rather than trusted.

Named by 29 essays across 11 fields — each of them below, with the objects they name alongside it.

recovered principal pointused to drawrecoveredgapfocal length853.90853.904e-15principal x345.0345.02e-12angle44.0°44.0°—correct from 20 cm, at 160 mm wide44° across

Recovering the camera from the picture it drew

Draw a box from a known camera, forget the camera, and get it back from the twelve drawn edges alone. Agreement to one part in 10¹⁵ is a statement about the geometry, because the only thing that crossed between the two halves was a list of line segments.

foundations · Recovery
fitted k₁ = -0.280000true -0.280000, off by 5e-15

Fitting a lens from straightness alone

No calibration target, no known scene, no camera. Only the knowledge that some edges in the picture were straight — and the coefficient comes back to fifteen digits. Then it comes back with a companion, and the two are correlated at −0.997.

lens · Plumbline
no single viewpoint — the rays miss by 4.5 px, depth-dependentf recovered from it: 396.88 px

What survives a pane of glass

A slab of glass moves every point of a picture and moves no direction at all. So the camera recovered from a photograph taken through a display case is exactly the camera that took it — out of a picture in which nothing is where it was.

refraction · Slab
one pixel is an areacentrescornersprincipal point moves0.707 pxfocal length changes by4.5e-13 pxan edge-versus-centre viewport1.303 pxa half-pixel convention is a principal-point error; an off-by-one viewport is a focal-length error8 vertices, all shifted by the same 0.7071 pxspread across marks 0.0e+0 px

A pixel is not a point

Where the sample sits inside a pixel is a convention, and getting it wrong shifts every mark by half a pixel in each axis. What that costs can be measured by recovering the camera from the picture — the answer is a principal point exactly 0.707 px from the truth with the focal length untouched, and the other half-pixel mistake does precisely the reverse.

pipeline · Viewport
k₁ = -0.28 · the round trip closes to 8.0e-13 pxpale: what the eye receives · dark: what the renderer drawsthe inner 86% of a 72° frame, where the inverse is exact

The render is distorted on purpose

A headset renders a bent picture so its lens can straighten it, which is a lens's distortion polynomial run backwards, and the one case in which distortion is introduced deliberately. The round trip closes to a thousandth of a millionth of a pixel, and the price is that one rendered pixel becomes 0.493 delivered pixels at the edge of the field and one at the centre.

screen · Distortion
horizoncentre of the picture0.58° of lean, invisiblethe horizontals are unaffected

The third point put where it looks right

Three-point perspective is taught as two vanishing points plus a third placed by judgement. The third is not free: two points and the centre of the picture fix it exactly. It survives being placed by eye because in the layout a book draws it belongs thousands of pixels off the paper, where 400 px of error costs less than a degree — and in a photograph taken looking up at a tower the same 400 px costs ten.

wrong · Pointcount
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

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 the round trip of camera recovery 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.

sensor · Pixelaspect
15° of yaw, 6° of pitch, 1.50 throw ratio81.3% of the panel reaches the corrected rectangleouter: the thrown quadrilateral · inner: what correction can keep18.7% of the panel discarded

A projector is a camera run backwards

Turn a projector fifteen degrees from square and it throws a trapezium; keystone correction cannot add light outside it, so it shrinks the picture until it fits and discards a sixth of the panel. And the instrument itself comes back out of the picture it threw — 2880 panel pixels recovered against 2880, by the function the wrong field wrote for hand-drawn cubes.

screen · Keystone
00.50011.50020406080field angle off the axis (degrees)picture radius, in focal lengthsfolds at 47.49°43.91°50.54°the radial factor reaches zeropinholefolds at 47.49°43.91° and 50.54° share one radius

A barrel model folds at a radius it sets itself

The polynomial every calibration fits to a wide lens stops increasing at a radius fixed by its own first coefficient — 47.49° of field at k₁ = −0.28 — and past it two directions land on one picture radius. The routine that undistorts pictures with it does not refuse there. It hands back wrong directions from 46.75°, by as much as 106.5°, and refuses only at 65.5°: a fifth of the field returned silently wrong.

lens · Distortion
principal point moved 22.30 px · focal length 0.584 px shorterlines straight to 1e-13 px

A tilted sensor is not a distortion

Tilt a sensor 3° out of square with its lens and every point of the picture moves — up to 7.5 px on the frame drawn here — yet every straight line stays straight to 10⁻¹³ px and the cross-ratio survives to 10⁻¹⁶. The picture is an ordinary pinhole picture whose principal point has moved 22.30 px. A calibration that frees its principal point absorbs it exactly; one that holds the principal point and reaches for tangential distortion terms leaves 1.87 px, and used as a correction it bends straight rows by 4 px.

lens · Distortion
three edges crowded on one side5.69e-3two on one side, one on the other5.66e-4three edges near the centre6.73e-3three edges placed by search9.57e-4the centre free · log scalebest: 5.66e-4

The lines that calibrate a lens

One straight edge through the centre of a picture says nothing about a lens's distortion, and one 180 px from the centre determines k₁ to 9.0 × 10⁻⁴ — the precision rises in proportion to the offset. But distance from the centre is not enough. Crowd three edges on one side and, the moment the distortion centre is also unknown, the coefficient is ten times worse, because a bend on one side looks like a moved centre; put one edge across the centre and it barely changes.

lens · Plumbline
34363840-0.50000.5001distance the lens is focused at (m, log scale)horizontal angle of view (degrees)38.99 at 3 m37.76 at 1 m35.90 at 0.5 m39.60° at infinity35.90° at 0.5 m

Focusing is a zoom

A 50 mm lens focused at half a metre is not a 50 mm camera. It stands 55.56 mm from the sensor, its picture is a pinhole picture at that distance, and it covers 35.9° where the same lens at infinity covers 39.6°. Recover the camera from the picture and it reports 55.56 mm. Read the picture with the engraved 50 mm instead and a right angle comes back as 96.0°.

sensor · Format
x axis, 54.7° off1.58°y axis, 63.5° off3.39°z axis, 46.9° off1.45°the frame's best rotation1.14°the recovered camera's turn3.37°wedge 2° · focal 1.33% short · principal point 16.6 pxframe mispredicted by 14.7 px

A wedge of glass turns the camera behind it

A pane with parallel faces moves every point and no direction, so the camera recovered through a window is the camera that took the picture. Tilt one face 2° and every direction turns, by 1.04° on the axis and 1.67° forty degrees off it. The best rotation of the frame, 1.14°, still leaves 0.94 px, and no homography does much better, so the picture is no longer a projection from the camera's centre. The camera recovered from three vanishing points through the same glass is turned 3.37° — three times as far — because vanishing points lie where the glass bends most.

refraction · Slab
00.50011.5020123where a pinhole would put the point, in focal lengths from the centrewhere the model puts itwhere the polynomial foldsthe division model's horizonboth at k = -0.42fold 42° · horizon 1.54

A model that inverts has a horizon instead of a fold

The polynomial every calibration fits turns around at a finite radius and stops being a map from direction to picture. The division model, chosen because it inverts in closed form, never turns around — it rises for ever toward a horizon at one over the root of its own coefficient, so the whole hemisphere of directions lands inside a finite disc. Fitted to the four fisheye laws it follows every one of them more closely than the polynomial at every field from forty degrees to eighty — a hundred times more closely for the equidistant law at forty, and the stereographic law exactly.

lens · Distortion
horizonprincipal pointv_zorthocentre: 812.7691 px · vᵀωu = 0: 812.7691 pxconjugacy residual 5.9e-10 in focal-length unitscorrect from 19 cm, at 160 mm wide46° across

One conic calibrates the camera

A focal length is usually recovered from two perpendicular vanishing points by an orthocentre construction with a square root in it. There is a second derivation with no construction and no square root — two vanishing points of perpendicular directions must be conjugate with respect to one conic in the picture — and the two agree to the last bit. They are not two methods. The conic is what a calibrated camera is.

foundations · Absoluteconic
0102030400.2000.4000.6000.800where along the edge, as a fraction of the visible lengthshare of the edge's response to the coefficient, in per cent93% outside the middle halfone edge, 82 marks, cut into tenthsmiddle two tenths: 1.4%

The response is at the ends and the information is not

A radial map bows a straight edge by an amount that grows as the square of the distance along it, so 93 per cent of an edge's response to the coefficient lies in its outer quarters. Spending the marks there is 16 per cent worse than spreading them evenly, because two clusters say nothing a shifted, tilted line could not say. What identifies the coefficient is a curvature, which needs three places — both ends and the middle, which beats an even spread by 11 per cent.

lens · Plumbline
012204060how far off the axis the read directions reach, in degreeshow far the recovered wedge angle is out, in degreesthe wedge's own angle — nothing recovered60 trials at each spread, half a pixel of reading error0.068° at 55°

The wedge recovered with the camera

Admit the glass into the model and the fit finally has something left over. A two-degree wedge is invisible to a reading confined inside eighteen degrees of the axis — the fit calls the whole displacement a rotation of the camera and is right to — and by fifty-five degrees it comes back to 0.07 of a degree. What the picture does not separate is the ordinary glasses — assuming an index of 1.50 for a true 1.52 costs one per cent in the angle and 0.07 pixels of residual.

refraction · Slab
0.30.71.537200.11101001000distance the lens is focused at (m, log scale)how far the recovered distance can be out (% , log scale)vanishing points ±0.25 pxvanishing points ±1 px±0.25 px: 0.7 % at 1 m → 28 % at 30 m50 mm lens

A close picture carries its own distance

A 50 mm lens focused at one metre stands 2.632 mm beyond its focal length, and a picture records where the lens stood. Recover that from two vanishing points, put in the engraved focal length, and the focus distance comes back — to 0.7 per cent at 1 m, 3.7 at 5 m, and as an interval 28 per cent wide at 30 m. A single picture has given a scale. What it has given is where the lens was focused, and the subject can be anywhere in a sharp band two to fifteen times wider.

sensor · Format
the lens, in the left mirrorcorrect from 15 cm, at 160 mm wide12 marks × 3 views

Two mirrors are three cameras

A photograph with two mirrors in it holds three views of the scene from three places, at baselines of 2.90, 3.10 and 2.26 metres. Two of the three pairwise geometries are mirror pairs and are skew; the third is a rotation by twice the angle between the mirrors, and it is not new evidence — five numbers read off the print rebuild it to 9.4 × 10⁻¹⁴ pixels, where a general three-view arrangement needs eighteen.

mirrors · Mirrorpair
0100200300distance from the picture's centre, pxeach edge, by how far it passes from the centreoffset 20 px20–326offset 60 px60–330offset 125 px125–348offset 180 px180–372four edges, 82 marks eachevery one spans 16× in radius

No design separates the two coefficients

Separating a squared term from a fourth-power one was supposed to need marks at radii far apart, which is a statement about where edges are placed. It is not: one straight edge already runs from 20 px to 326. Spreading ninety-six marks over three edges or sixteen changes the answer by 23 per cent, spreading the offsets makes it 19 per cent worse, and the correlation stays at −0.98 whatever is done. What a plumb-line calibration determines is one number, to 1.52 thousandths, and which number depends on the model.

lens · Plumbline
60 px160 px260 px360 pxmarks every 8 px, kept inside the frame47 / 125 / 114 / 122 marks

A known target sharpens the fit and does not separate it

Printed circles of stated size were supposed to break the −0.98 correlation between a lens's two radial coefficients, because a circle puts every mark at one radius and no straight edge can. They do not: every design of circles leaves the pair 0.979 to 0.9997 correlated, and for circles of known size the figure is exactly the cosine between r³ and r⁵. What a known target buys is precision — 3.8 times the straight edges' at the same budget — and only if its size in the picture is known to about a thousandth.

lens · Plumbline
a length on the ground3.22%1.00 m across the referencethe camera's height0.36%1.62 m above the grounda repeated object, size unknown3.60%the answer in units of the repeata standing object of known height0.41%1.75 m, upright, anywhere on the …the focal length and the horizon1.94%700 px, and where the ground's li…the spread of the answer, per closureshorter is better

Five facts that close the same gap

The gloss that one length has to come from outside the photograph names a single option, and there are at least five — a length on the ground, the camera's own height, a repeated object of unstated size, a standing object of known height, and the focal length with the horizon. All five give an answer on the same picture with the same noise; their spreads run from 0.36 to 3.60 per cent, a factor of ten, and which one is available depends on the photograph rather than on the arithmetic.

metrology · Scale
residual × 40 · rms 1.62 px at the readings · principal point moved 7.7 pxno single viewpoint — the rays miss by a wedge's worth, varying with incidencethe glass-blind calibration at 40°

A wedge moves the centre, not the lens

A wedge of glass in front of a lens deflects every ray by a little more the further off the axis it goes, which looks like the shape a radial distortion coefficient describes. Fitted together, the two are nearly independent — correlated at 0.16 at most — and a calibration that knows nothing of the glass does not invent a lens: it reports a coefficient of about 0.002, moves its principal point by 4.5 to 14 pixels, and leaves a swirling residual that no radial model takes. The blame goes to the camera's centre, and the residual says so from twenty-two degrees off the axis.

refraction · Slab
00.50011.502020406080angle off the axis, degreespicture radius, in focal lengthsequidistantequisolidorthographicstereographicthe division model's horizon, 2 focal lengthswide: the law · dashed: the division model at −1/4apart by 2e-16

A stereographic fisheye is a division model

The division model divides the picture radius by one plus a coefficient times its square. The fits that compared it with the polynomial were not of that model: they multiplied instead, and the model they measured has neither a fold nor a horizon. Fitted as it is written, the division model follows every fisheye law more closely than the polynomial at every field from forty degrees, and the stereographic law it follows exactly — the law is the model, with a coefficient of minus a quarter. Its horizon then turns out to sit beyond the lens's own ninety degrees, and pinning it there is a trade rather than a free constraint.

lens · Distortion
distortion centretilted 50° about a horizontal axis, marks every 8 px47 / 125 / 163 / 226 marks

A tilted target pays for its tilt in perspective

A calibration target of printed circles held square to the lens fixes a lens's first radial coefficient to 4.77 thousandths from ninety-six marks. Tilt it sixty degrees, fit the tilt along with everything else, and the same ninety-six marks fix it to 1.70 — nearly three times better. Squash the circles by the same angle without perspective and nothing is gained. What pays is the near half of each circle being drawn larger than the far half, which spreads a circle's marks across a band of distances from the lens's centre.

lens · Plumbline
00.2500.5000.750120406080assumed centre of the picture, % of the way between the vanishing pointsreconstructed proportion of the rectanglethe rectangle that was there, 0.667 : 115.7× across the arcevery one a true rectangle

The proportion is the assumption

Read the proportions of a rectangle out of a photograph of it and the answer is a function of where the centre of the picture is assumed to be. Sweeping that assumption across the horizon takes one drawn quadrilateral from one part in fourteen to slightly wider than square, every reconstruction a genuine rectangle, and only a fiftieth of the sweep within five per cent of the truth.

construction · Rectangle
the horizonthe centre, 318focal 622.396 pxtrue 622.396 px

Perpendicular is a pairing

On a horizon, the vanishing point of a direction and the vanishing point of the direction at right angles to it are joined by a map that is its own inverse. Such a map has two degrees of freedom rather than three, so two pairs determine it — and its two imaginary fixed points are the focal length and the centre of the picture, handed back from two rectangles on one floor with nothing assumed.

foundations · Involution
00.2500.5000.7501020406080angle off the optical axis (degrees)image radius, against the radius the same lens gives at 90°equidistantequal-areastereographicorthographicflat planeeach curve divided by its own radius at 90°54.0% apart at 45°

Which rule a fisheye obeys, from straightness alone

Four candidate rules for a fisheye lens part by 54.0 per cent at 45° off axis, and a plumb-line fit shown no scene, no camera and no calibration target can still name which one took a photograph — reliably from about 45° of half-field. Below that the four are indistinguishable in the marks, and naming one collapses to guessing.

curved · Fitlaw
the photographv1v2v3orthocentre = principal pointcorrect from 4 cm, at 30 mm wideself-polar to 3.1e-13 px · orthocentre 1.4e-13 px

The triangle a camera cannot move

Three mutually perpendicular directions give three vanishing points, and that triangle is self-polar with respect to the image of the absolute conic — to 3.1e-13 px, with no length and no angle anywhere in the statement. Turn one direction two degrees out of square and the polars miss their sides by 65.8 px. The statistic this collection has been printing as evidence for the same claim, meanwhile, is an identity that cannot fail.

foundations · Poleandpolar

Named alongside it

The objects these essays reach for when they reach for this one.

Principal pointConditioningFocal lengthResidualVanishing pointRadial distortionDemonstrationerror propagationfield of viewplumb-line calibrationBrown–ConradyCorrelation

All concepts