The real instrument

A level picture shows its rise on its horizon, and hides its slide

A shift lens moves the principal point off the middle of the frame, and the textbook focal length from two vanishing points pays for assuming it did not. On a level camera the payment is optional. The principal point lies on the horizon, so a rise is read straight off the picture and costs nothing; a slide along the horizon is read by nothing at all, because two vanishing points fix only a semicircle of possible cameras. What a sideways crop costs then depends on how the building is turned: a tenth of the frame trimmed off the side is 23 per cent of the focal length on a facade seen eleven degrees off square and under one per cent at forty-five.

Worth reading first: The principal point is not the centre · Recovering the camera from the picture it drew.

The principal point is not the centre measured what the textbook route to a focal length costs on a shifted or cropped photograph. The route takes two vanishing points of perpendicular horizontal directions — the two walls of a building, say — and solves f2=−(v1−p)⋅(v2−p)f^2 = -(v_1 - p)\cdot(v_2 - p) for the focal length, with the principal point p supplied from outside. Every textbook supplies the middle of the frame. A shift lens, a view camera’s rise or an off-centre crop moves the principal point elsewhere, and the essay found 1.6 per cent of error at 150 pixels of shift on a 44-degree lens, more on a wider one.

It also found an awkward pairing. The route that does not assume the principal point — three vanishing points and their orthocentre, the construction recovering the camera uses — needs a finite vertical vanishing point, and a shifted photograph is exactly the photograph whose verticals stay parallel, because the shift exists to keep them so. The picture on which the assumption costs most is the picture on which it cannot be avoided by the orthocentre.

It can be avoided another way, for half of what a shift does. The other half cannot be avoided at all, and how much that half costs depends on something the earlier essay did not vary: which way the building is turned.

The principal point is on the horizon

A shift lens keeps the camera level. Its optical axis is horizontal, so the plane through the eye and parallel to the ground — the plane whose image is the horizon — contains the axis, and the axis meets the picture at the principal point. A level camera’s principal point lies on its horizon, exactly, however far the lens is shifted. The horizon at eye level is the same statement from the other side: the horizon is the image of the eye’s own height.

The horizon is in the picture. Both walls of a rectangular building are horizontal, so their two vanishing points lie on it, and the line through them is it. A reader who has the two vanishing points has the horizon and therefore the principal point’s height — not assumed, measured. What remains unknown is where along the horizon the principal point sits.

That divides every shift into two parts. A rise moves the principal point up or down, across the horizon; the horizon reads it. A slide moves it left or right, along the horizon; nothing in the two points reads it.

Two vanishing points fix a semicircle of cameras, not one: slid 100 px along the horizon, the true camera has a focal length of 854 px and the middle column says 788 — -7.7%A level camera with a 44° field looking across the corner of a building, turned 30° from one wall towards the other, its principal point moved 100 px sideways along the horizon by a shift or a crop. The building's horizontal edges meet at -48 px and 1924 px on the horizon. Every principal point between them on the horizon satisfies the right-angle condition f² = −(v₁ − p)·(v₂ − p) with its own focal length — the height of the semicircle on the two points at that column — so the two points fix the semicircle and nothing about where on it the camera stood. The true camera, at column 445, has 853.9 px; the middle column of the frame, 345 px, reads 787.8 px. The rise is not on this drawing at all: a level camera's principal point lies on the horizon, so its height is read, and only its column has to be assumed.02505007501e+305001e+31.5e+3column of the picture, px (the frame runs from 0 to 690)focal length the two points imply there, pxtrue: 854 pxmiddle column: 788 pxthe frameturned 30°, a 44° lensslid 100 px: -7.7%
Fig. 1 A level camera turned 30° across a building’s corner. The two vanishing points sit on the horizon; every column between them, taken as the principal point, implies its own focal length — the height of the semicircle there. Slid 100 px, the true camera has 854 px and the frame’s middle column says 788 (−7.7%).

The figure draws the unknown part. Hold the two vanishing points fixed and let the principal point be any column on the horizon between them. For each, the right-angle condition gives a focal length, and the focal lengths trace a semicircle with the two vanishing points at the ends of its diameter. Every point on it is a camera that would draw these two vanishing points exactly. The arc every eye stands on found this semicircle for a drawn rectangle, where every station on it reconstructs a genuine rectangle of a different proportion; in a photograph the same arc is a trade between the principal point’s column and the focal length.

The slider slides the true principal point along the horizon by 0 to 200 pixels. The frame’s middle column stays where it is, and the focal length it reads falls further from the true one at each step: 7.7 per cent short at 100 pixels for this turn of the building. A rise would not appear on this drawing at all, because a rise moves the horizon up or down the frame and the semicircle with it, and the middle column, now read on the moved horizon, lands on the semicircle at the same place.

A rise costs nothing once the horizon is used

The earlier essay’s measurement put the principal point at the middle of the frame in both coordinates, so its error came entirely from height: a pure rise was what it shifted. Read on the horizon instead, the same rise costs nothing.

A rise of 150 px costs the focal length -1.55% with the principal point at the middle of the frame and nothing with it on the horizonLevel cameras with a 44° field turned 15, 30, 45° across a building's corner, their principal points raised from 0 to 200 px by a shift or a crop. The focal length from two vanishing points with the principal point at the middle of the frame: 0.00%, -0.17%, -0.69%, -1.55%, -2.78% at 0, 50, 100, 150 and 200 px — identical, to 0e+0%, at every turn, because the rise moves the assumed point straight off the horizon and the error is the square root of one minus the rise squared over the focal length squared. With it on the horizon at the middle column: zero at every rise and every turn, to 0e+0%. The rise moved the principal point off the middle of the frame and along the vertical, where the horizon reads it; reading it there takes back the whole of the error.-3-2-10050100150200how far the principal point is raised above the middle of the frame, pxerror in the focal length (%)middle of the frameon the horizon: 0a 44° lens, exact vanishing pointsthe same at 15°, 30°, 45°
Fig. 2 The focal length’s error as the principal point rises 0 to 200 px. At the frame’s middle: −0.17%, −0.69%, −1.55%, −2.78% at 50, 100, 150, 200 px, identical whether the building is turned 15°, 30° or 45°. On the horizon at the middle column: zero at every rise and every turn.

The dashed curve is the textbook’s cost, and it reproduces the earlier essay’s 1.55 per cent at 150 pixels. It does not depend on how the building is turned, which is worth noticing: a rise moves the assumed point straight off the horizon, the right-angle condition then reads the true focal length shortened by the square root of one minus the rise squared over the focal length squared, and neither vanishing point’s position enters. The solid line is the cost of the alternative, zero to the last bit, at every rise and every turn.

So the earlier essay’s recommendation for the awkward case — read the shift off the vignetting, find a third perpendicular direction, or fit the principal point on several views — is needed for only half of the awkward case. For a camera that was level and risen, which is how a shift lens is almost always used, the horizon is already in the picture and already carries the rise. The textbook’s error was never a cost of shifting; it was a cost of not reading the horizon.

A slide costs in proportion to how far the building is turned

The other half is the slide, and here the semicircle decides everything. A camera whose principal point is slid along the horizon, read at the middle column, lands on the semicircle somewhere other than where it stood, and the focal length it reads is the semicircle’s height there instead.

Turned 30°, a slide of 50 px along the horizon costs the focal length -3.6% one way and 3.2% the otherA level camera with a 44° field turned 30° across a building's corner, its principal point slid from 200 px left to 200 px right of the middle of the frame, read on the horizon at the middle column. Error in the focal length: -200 px, 10.25%; -100 px, 5.90%; -50 px, 3.16%; 0 px, 0.00%; 50 px, -3.62%; 100 px, -7.75%; 200 px, -17.86%. Near zero the error grows at -0.068% a pixel, which is 100·cot 2ψ / f: the middle column sits off the top of the semicircle by f·cot 2ψ, so a slide there changes the focal length in proportion. At 45° the middle column is the top, the first-order term vanishes, and only the square of the slide is left.-50050-200-1000100200how far the principal point is slid along the horizon, px (right positive)error in the focal length (%)turned 30°a 44° lens, exact vanishing points-0.068% a pixel at the middle
Fig. 3 The focal length’s error as the principal point slides 200 px either way along the horizon, read at the middle column. Turned 30°: −3.6% at 50 px right, +3.2% at 50 px left, at 0.068% a pixel near zero. The slider turns the camera to 10°, 20° or 45°: at 10°, −17.9% and +14.8%.

The error is first order in the slide, with either sign, and its slope near zero is 100·cot 2ψ/f per cent a pixel, where ψ is how far the camera is turned from one wall. That has a plain geometric reading. For a level camera turned ψ, the two vanishing points sit at f·cot ψ to the right of the principal point and f·tan ψ to its left, so the middle of their diameter is f·cot 2ψ to the right. The principal point is that far from the top of the semicircle, on its slope, and a slide moves it up or down the slope in proportion.

The slider shows what that does across ordinary buildings. Turned 30 degrees, a 50-pixel slide costs about 3.4 per cent. Turned 10 degrees — a facade seen nearly square, which is how most buildings are photographed, with the far wall a sliver running towards a distant vanishing point — the same 50 pixels cost 15 to 18 per cent. Turned 45 degrees, the two vanishing points straddle the principal point evenly, it sits at the top of the semicircle, the first-order term vanishes, and 50 pixels cost a sixth of a per cent.

The sign is readable too, and it is the useful part for anyone checking a claim about which lens took a picture. Slide the true principal point towards the distant vanishing point and the frame’s middle is left nearer the close one, down the steep side of the semicircle, so the reading comes out short: a wider lens than was used. Slide it towards the close vanishing point and the middle column sits further up the semicircle, towards its top where the slope flattens, and the reading comes out long, by less. At 30 degrees, 200 pixels towards the distant point cost 17.9 per cent and 200 pixels towards the close one 10.3.

The earlier essay noted that a sideways crop is first order and a rise second. The semicircle says how big the first-order term is and why: it is set by how lopsided the two vanishing points are about the principal point, and a nearly square view of a facade, with one vanishing point inside the frame and the other thousands of pixels away, is as lopsided as an ordinary photograph gets.

Edges read with error leave the horizon as good as the truth

Every figure so far uses exact vanishing points, and a real reading finds them by extending edges that were marked with some error. The question is whether reading the principal point off a horizon that is itself measured adds anything to the error the edges already cause.

Read from eight edges a vanishing point at half a pixel, the horizon's principal point costs 0.88% — the same as knowing the true one, 0.88% — and the frame's middle 1.56%A level camera with a 44° field turned 30°, its principal point raised 138 px — a shift lens near full rise. Each vanishing point is read from eight edges 160 px long at random places in the frame, their ends marked with 0.25, 0.5, 1, 2, 4 px of error; 200 pictures a point. Median error of the focal length with the principal point at the middle of the frame: 1.38%, 1.56%, 2.48%, 5.25%, 12.71%. On the horizon the edges imply, at the middle column: 0.43%, 0.88%, 1.92%, 4.47%, 11.61%. At the true principal point: 0.43%, 0.88%, 1.92%, 4.47%, 11.57%. The rise read off the horizon is out by a median 0.5, 1.0, 2.1, 4.3, 10.2 px. The focal length is set by how far apart along the horizon the two points are, and the horizon's height enters it only at second order, so reading the principal point there costs nothing the edges have not already cost.0.250.51240.10.31310error of each marked edge's ends, px (log)median error in the focal length, % (log)middle of the frameon the read horizonthe true principal pointraised 138 px, eight edges a point, 200 picturesthe horizon and the truth coincide
Fig. 4 A camera turned 30° and risen 138 px, each vanishing point read from eight edges of 160 px with their ends marked to 0.25–4 px; 200 pictures a point. Median focal error at half a pixel: frame’s middle 1.56%, on the read horizon 0.88%, at the true principal point 0.88%. The two lower lines lie on each other.

It adds nothing that can be seen. With edges marked to half a pixel, the focal length from the true principal point is out by a median 0.88 per cent, because the vanishing points themselves are uncertain; from the principal point on the read horizon, also 0.88. The horizon’s height is read to about a pixel — a median 1.0 pixel off the true rise at half a pixel of marking — and that error barely touches the focal length. The focal length is set by how far apart the two vanishing points are along the horizon. Moving the assumed principal point a pixel up or down changes the right-angle product by the square of that pixel, a second-order amount, and the first-order part of the product is about positions along the horizon, which the edges measure equally well whichever principal point is used.

The frame’s middle adds its bias on top: 1.56 per cent at half a pixel, which is the 1.31-per-cent rise error and the edges’ own scatter combined. At four pixels of marking the edges dominate everything and all three readings are poor, near 12 per cent. In between, the horizon reading is the one that matches the floor the edges set.

There is a further consequence worth stating. A careful reader who marks edges to half a pixel and reads the principal point off the horizon has a focal length good to about one per cent from two vanishing points, on a shifted photograph the earlier essay judged awkward. The orthocentre construction would have nothing to work with, since it needs a third vanishing point and that is exactly what the shifted photograph lacks.

Which crops are which

The two halves of the shift sort the ordinary operations on a photograph by whether they hurt.

A trim of a tenth of the frame's width costs -23.0% turned 11° and -0.75% turned 43.5°; a rise of the same 69 px read at the frame's middle never costs more than 0.33%Level cameras with a 44° field turned from 6° to 86° across a building's corner, their principal points moved 69 px — a tenth of the frame's width — sideways, read on the horizon at the middle column, or upwards, read at the middle of the frame as the textbook does. The sideways trim: 11°, -22.96%; 21°, -9.78%; 31°, -4.74%; 43.5°, -0.75%; 56°, 2.90%; 66°, 6.72%; 78.5°, 17.23%. The rise read at the middle of the frame: 6°, -0.33%; 26°, -0.33%; 46°, -0.33%; 66°, -0.33%; 86°, -0.33% — the same at every turn, because a rise moves the principal point straight off the horizon and the error is the square of the move over the focal length. The trim's error changes sign at 45°, where the two vanishing points straddle the principal point evenly, and grows without limit towards a wall seen square, where one of them runs off to infinity and the semicircle grows with it.-2002010203045607080how far the camera is turned from one wall, degreeserror in the focal length (%)trimmed 69 px sidewaysraised 69 px, frame's middle45°: the two points straddle evenlya 44° lens, exact vanishing pointsa trim is first order, a rise second
Fig. 5 A trim of a tenth of the frame’s width (69 px) read on the horizon, against the turn of the camera from one wall: −23.0% at 11°, −4.7% at 31°, −0.75% at 43.5°, +6.7% at 66°. A rise of the same 69 px read at the frame’s middle: −0.33% at every turn. The trim’s error changes sign at 45°.

A tenth of the frame trimmed off one side moves the principal point 69 pixels along the horizon, and what that costs depends entirely on the building. Eleven degrees off square it is 23 per cent of the focal length, enough to call a 35-millimetre lens a 27. At 31 degrees it is under five per cent; at 43.5, under one; past 45 it changes sign and grows again towards the other wall seen square. The rise of the same 69 pixels, read at the frame’s middle as the textbook does, costs a third of a per cent at every turn — and read on the horizon, nothing.

So the two operations the earlier essay called equally innocent in an image editor are not merely different in order. One is fully recoverable from the picture and the other is not recoverable at all, and the one that cannot be recovered is the one whose cost varies by a factor of thirty with the view.

Four crops of a frame turned 30°: the horizon takes back every error a cut from the top makes and none of what a cut from the side makesA level camera with a 44° field and a 3:2 frame, turned 30° across a building's corner, then cut four ways; the size of the error in the focal length from two vanishing points with the principal point at the middle of the new frame, and on the horizon at its middle column. 3:2 cut to 16:9, top kept (principal point 0 px across and 36 px up or down from the new middle): middle 0.09%, horizon 0.00%; a shift lens near full rise (principal point 0 px across and 138 px up or down from the new middle): middle 1.31%, horizon 0.00%; 3:2 cut to a square, left kept (principal point 115 px across and 0 px up or down from the new middle): middle 9.10%, horizon 9.10%; a tenth trimmed off the left (principal point 34.5 px across and 0 px up or down from the new middle): middle 2.23%, horizon 2.23%. A cut from the top or bottom moves the principal point along the vertical, which the horizon reads; a cut from the side moves it along the horizon, which nothing in two vanishing points reads, and at this turn that is the expensive direction.02.5057.5010size of the error in the focal length (%)3:2 cut to 16:9, top kepta shift lens near full rise3:2 cut to a square, left kepta tenth trimmed off the leftupper bar: middle of the framelower bar: on the horizon
Fig. 6 Four crops of a 3:2 frame turned 30°, the size of the focal error from the new frame’s middle (upper bar) and from the horizon (lower bar). Cut to 16:9, top kept: 0.09% and 0. A shift near full rise: 1.31% and 0. Cut to a square, left kept: 9.10% and 9.10%. A tenth off the left: 2.23% and 2.23%.

Cutting a 3:2 frame to 16:9 by keeping the top band, which is what happens when a horizon is being placed, moves the principal point 36 pixels from the new middle, all of it vertical. The textbook pays 0.09 per cent for that, the horizon nothing. A shift lens near full rise moves it 138 pixels, vertically: 1.31 per cent and nothing. Cutting the same frame to a square keeping the left side moves it 115 pixels along the horizon: 9.10 per cent, and the horizon cannot help because the error is entirely in the direction the horizon does not measure. A tenth trimmed off the left costs 2.23 per cent either way.

That gives a short rule for a reader handed a photograph whose history is unknown. If the edges of the frame might have been trimmed top or bottom, read the principal point’s height off the horizon and the trimming does not matter. If the sides might have been trimmed, the two-point focal length carries an unknown error whose size is set by the building’s turn: small for a corner seen near 45 degrees, large for a facade seen nearly square. Quote it with that condition, or find something else that fixes the column.

What two vanishing points can and cannot say

Put together, a level photograph of a rectangular building fixes three things and leaves one free. It fixes the horizon, and on the horizon the principal point’s height, and with them a semicircle of possible cameras on the two vanishing points as diameter. It leaves free where on the semicircle the camera stood: the principal point’s column and the focal length, traded against each other one for one. An angle is a cross-ratio and one conic calibrates the camera say the same thing algebraically — two perpendicular vanishing points impose one condition on the camera’s calibration, and a level camera with unknown principal point and focal length has three unknowns, of which the horizon supplies one.

That is the honest summary of what a shift costs. The rise, which is the shift photographers actually use, is fully recoverable from the picture, and the textbook’s error on it was a failure to read what the picture holds. The slide is not recoverable from two vanishing points by any method, and the sensible response is not a better formula but a statement of the condition: this focal length is right if the frame was not trimmed sideways, and wrong by about cot 2ψ per cent for every focal length’s hundredth of trimming if it was.

A height from one photograph is unaffected by any of this, which is a small mercy worth repeating from the earlier essay: heights come from the horizon and the vertical vanishing point, neither of which involves the principal point. It is lengths that need the focal length, and with it the column.

The level camera the argument assumes

The camera is level. Everything here rests on the principal point lying on the horizon, which is true only when the optical axis is horizontal. A camera tilted up and then shifted down to compensate, or a photograph straightened in software after being taken tilted, does not have that property: its principal point is off the horizon by f·tan of the tilt. Such a picture has converging verticals, though, so the orthocentre construction is available to it, and the awkward pairing the earlier essay found does not arise.

The two walls are perpendicular and horizontal. A building whose corner is not a right angle gives two vanishing points on the horizon that the right-angle condition misreads; the semicircle is then the wrong curve, and the error is the angle’s own, not the principal point’s. Every reading from two vanishing points carries this assumption, and none of the measurements above relax it.

The lens draws straight lines straight. A lens with barrel distortion bends the edges a reader extends, and its vanishing points move with it. Straight lines that are not is about that; distortion is radial about the principal point, so a slid principal point also moves where the distortion is centred, and a correction applied about the frame’s middle leaves exactly the decentring residual the earlier essay described.

The edges are marked independently. The noise figure draws each edge’s ends with independent errors. A reader who marks edges systematically too steep or too shallow shifts every vanishing point together, and a shared bias in the vanishing points is a bias in the focal length that no number of edges removes.

Still open: what else fixes the column

Two vanishing points leave the principal point’s column free, and the cost of guessing it is largest exactly where photographs most often sit, with a facade seen nearly square. Something else in the picture has to fix it, and the candidates are not equally good.

A third direction that is perpendicular to both walls and not vertical does not exist for a building. But many scenes contain a second rectangular object turned at a different angle to the first — a kerb, a parked car, a paving pattern, a second building — and each supplies its own two vanishing points on the same horizon and its own semicircle. The true camera lies on both semicircles, and two semicircles on one line meet in at most one point above it. The measurement that settles what that is worth takes a level, slid camera looking at two rectangular objects turned by a stated angle relative to each other, reads all four vanishing points from edges marked with half a pixel of error, intersects the two semicircles, and asks how well the column and the focal length come back as the two objects’ turns are brought together — since two objects turned alike draw two nearly identical semicircles whose intersection is nearly undefined — and whether a difference in turn of twenty degrees already does as well as knowing the principal point outright.

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.

Named objects

A flat tag is an object no other essay names yet.

Focal lengthHorizonIdentifiabilityPrincipal pointShift lensStation pointVanishing point