Concept

Camera matrix — where it appears

The array that carries a camera's focal length and principal point, and takes a world point to a picture in one multiplication. Its four lateral entries carry the focal length and the principal point and nothing else, and its bottom row is the only place the depth acts as a divisor.

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

epipoleepipoleleft pictureright pictureepipole from 44 correspondences vs the projected eye: 1.1e-9 px2.60 m between the eyes

The image of the other eye

Two photographs of one courtyard, and in each of them a point that is the other camera. It is computed from forty-four matched marks and nothing else, and it lands on the projection of the other eye to about a billionth of a pixel.

twoviews · Epipole
x/z, y/z — the pinholeM·p, then divide by wworst disagreement 4.0e-14 px over 8 verticescorrect from 21 cm, at 160 mm wide42° across · near 0.1 m, far 1000 m

The divide is postponed, not avoided

A renderer does not divide by depth. It multiplies by a four-by-four matrix that carries the depth in a fourth coordinate and divides later, and the postponement is not an optimisation — it is what makes clipping and texture interpolation possible at all. The matrix and this site's pinhole put every point on the same pixel to five parts in a hundred trillion.

pipeline · Homogeneous
clipped at the near planedivided without clippingdirection cosine -1.0000 — the far end is drawn 2142 px away20 grid segments, 2.4 m of them behind the eyea reversed line is not a large error, it is a different picture

What happens behind the eye

A point behind the camera has a perfectly plausible image. Dividing by a negative fourth coordinate flips both signs, so the point lands through the principal point on the far side of the frame, and a segment crossing the eye plane is drawn straight, inside the frame, and running in exactly the opposite direction — a direction cosine of −1.0000.

pipeline · Clipping
00.2500.5000.7501-10123distance from the eye — log₁₀ metresfraction of the buffer's codes used uphalf the codes by 0.20 ma linear map, for comparisonnear 0.1 m, far 1000 mharmonic mean 0.20 m against arithmetic 500 m

The precision a depth buffer has left

Depth is stored as an affine function of one over the distance, so half of a buffer's codes are spent before the harmonic mean of the near and far planes — twenty centimetres out of a kilometre. The resolution goes as the square of the distance, and the fix that works is not more bits.

pipeline · Zbuffer
points in front of both camerasR₁, t0 of 44180° from the truthR₁, t reversed0 of 44180° from the truthR₂, t44 of 44chosenR₂, t reversed0 of 44180° from the truththe chosen pose is the true one to 0.0e+0°cheirality, not algebra, picks it

Four cameras fit, and one of them can see

The essential matrix does not determine a camera pair. It determines four, all of which reproject every correspondence exactly, and the thing that picks one is not more algebra — it is the assumption that the photographer could see what was photographed.

twoviews · Cheirality
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
-0.400-0.200000.2000.4000.6000.8001position across the drawn surfacehow far along the real surface, minus how far along the drawn one(√k−1)/(√k+1) = 0.5195at the page's midpoint, 40.9%depth ratio 10 : 1peak 0.5195 at s = 0.760

A texture does not interpolate on the page

Walking across a drawn surface at a constant rate walks across the real one at a rate that changes, and the worst gap is a closed form in the depth ratio alone — 0.52 at ten to one, more than half the whole range. It is exactly the error a person makes dividing depth by eye, made by a machine, and the fix is the fourth coordinate the pipeline kept.

pipeline · Perspcorrect
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
the eyenear 0.90 mfar 4.20 mfocal 740 pxprincipal 345, 210

Four numbers and a window

A projection matrix is built from six numbers and one of them is not a number at all. Four sides carry the focal length and the principal point; the near and far planes move nothing a reader can see; and the bottom row, (0, 0, 1, 0), is the only place the depth divides — set it to (0, 0, 0, 1) and the same machine draws a parallel projection.

pipeline · Frustum
worst 1e-13 px outcorrect from 17 cm, at 160 mm wide3 × 3 tiles

A tile is an off-centre frustum

Rendering a picture in tiles is exact, and the way to do it is one line of arithmetic: a tile's sides are the whole frustum's sides read at the tile's own pixel bounds. Aiming the camera at each tile instead is defensible at every step and is a different picture, out by about a tenth of a tile whatever the tile size.

pipeline · Tiling
24 kept · 26 clipped · every mark unmovedcorrect from 17 cm, at 160 mm wideclip plane tilted 18°

The near plane can be any plane

Rewrite one row of a projection matrix and the near plane stops being perpendicular to the axis and becomes whatever plane is asked for. Every x and every y is untouched — it is the same projection of the same scene from the same eye — and the depth order is wrecked, which is a clean separation of the two things a projection matrix does.

pipeline · Clipping
01230123the plane moved by a factor of ten to the …depth resolution, relative (powers of ten)near plane, brought infar plane, pushed out1/near − 1/farone term does all the work

One plane is nearly free

The near and far planes enter a depth buffer's precision through 1/near − 1/far, and one of those reciprocals is enormous. Pushing the far plane out by a factor of a thousand costs a tenth of a per cent; bringing the near plane in by the same factor costs a factor of a thousand — and an infinite far plane is the limit of the first rather than a separate case.

pipeline · Zbuffer
the seat3 chords against the arccurved monitor, 3 flat pieces6.80 mm of sag · 5.50 px at the seat

A curved screen is eight flat ones

A projection matrix is a plane and nothing else, so a curved display cannot be rendered — it has to be driven as several planes and assembled. The gap between chord and arc is the whole error, it goes as the square of the angle each piece spans, and the piece count therefore goes as the inverse root of the tolerance — three for eight pixels, eight for one, fifteen for a quarter.

pipeline · Tiling
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
6 vertices with w = 0 · each on its vanishing point to 7e-12 pxcorrect from 17 cm, at 160 mm wideedges extended to where their w = 0 vertex lands

A point at infinity is an ordinary vertex

Give a vertex a zero in its fourth slot and it stops being a point and becomes a direction — and the projection matrix draws it anyway, through the same multiply and the same divide, on that direction's vanishing point to seven trillionths of a pixel. Slide the eye ten metres and it does not move. Two of them bound a ground that reaches the horizon, where a ground drawn to ten kilometres stops a fifth of a pixel short.

pipeline · Homogeneous
5710142028400.31310distance along the floor from below the eye (m, log scale)pixels one shadow-map texel spans on screen (log scale)1 pxlamp beside the eyelamp 30 m overheadlamp 40 m ahead, facing backmeasured against the closed form: 4e-91024-texel map · eye 1.7 m · 50° field

A shadow map's texels land by two distances and two cosines

A renderer finds its shadows by taking a second picture from the lamp and storing a depth in every texel. Each texel reaches the screen through the surface it falls on, and how many pixels it covers there is a closed form — two focal lengths, two distances and two cosines. From a lamp beside the eye every texel lands at 0.79 px; from a lamp 40 m ahead facing back, the same map lands texels of 8.69 px on the floor 5 m out.

pipeline · Shadowmap
the true planefirst number of the plane, from the true valuesecond44 points in front: 31.9 % of the slicethe third number held at its true value

Seeing the scene fences in the plane at infinity

A reconstruction made without the calibration does not know which of its planes is infinitely far away. Requiring every point to lie in front of both cameras rules out every candidate that would tear the courtyard, and what is left is a convex region — 32 per cent of a generous slice — that always holds the true plane and never shrinks to it.

twoviews · Cheirality
the whole picture, one density9530²the frustum fitted to the floor7322²the best projective warp of its rows897²the best warp of its rows, any shape840²one texel per pixel of the floor385²the same, with a wall at every point502²facing lamp, floor to 60 m, no texel over a pixel · log scale÷113 by one warp

One warped shadow map, and what it cannot reach

The lamp facing the eye needed a shadow map 9,530 texels square — 90.8 million texels — for none of them to land on the near floor larger than a pixel. Fitted to the floor and warped by one projective parameter, the same map needs 805 thousand; nothing can do better than one texel per pixel of the eye's picture, 148 thousand. What stays out of reach is not the cosine of a surface, which a warp absorbs, but two surfaces that want different densities along one ray from the lamp.

pipeline · Shadowmap
correct from 8 cm, at 160 mm widestretch 1.358 · centres 4.28 px

The ball at the edge of the frame

A ball photographed near the edge of a wide picture is not drawn as a circle. It is an ellipse, longer along the radius from the centre of the picture than across it, and the centre of that ellipse is not the image of the centre of the ball. Both are properties of the flat sheet the picture is on, and an exact pinhole produces both.

foundations · Quadric
correct from 18 cm, at 160 mm wideoutline from the duals · ellipse

Every quadric has one outline

The curve where a solid turns away from the eye is the section of the solid by one plane — the eye's polar plane — and the outline is three matrix products with no sampling in them. It works for a ball, a dish and a hyperboloid, and it fails for a cone, whose dual outline collapses to a single point and forgets which two lines pass through it.

foundations · Quadric

Named alongside it

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

Homogeneous coordinatesDemonstrationClip spaceView frustumPrincipal pointFocal lengthProjective mapQuantisationResidualSampling gridCamera calibrationcentre of projection

All concepts