The second eye

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.

Worth reading first: Recovering the camera from the picture it drew · Where parallel lines meet.

Every essay on this site so far has had one camera in it. Sometimes the camera is stated and the picture is drawn from it; sometimes the picture is handed over and the camera is recovered from the drawn edges. Either way there is one eye, one projection, and one set of things that survive it.

This field has two. And the first thing worth knowing about two pictures of one scene is that each of them contains the other camera.

Not a picture of the other camera — the second photographer need not be standing in shot. A point. There is one point in the left-hand picture which is the image of the right-hand eye, and one point in the right-hand picture which is the image of the left-hand eye, and both of them can be found in the pictures without knowing anything at all about where either camera was.

The other eye, found in the picture — 2.6 m apartTwo views of one courtyard. In each panel the arrow points at the epipole: the image, in this picture, of the eye that took the other one. It is computed from the 44 correspondences alone, as the null vector of a fundamental matrix that has never been shown a camera, and it lands on the projection of the other eye to 1.1e-9 px on the left and 3.7e-10 px on the right.epipoleepipoleleft pictureright pictureepipole from 44 correspondences vs the projected eye: 1.1e-9 px2.60 m between the eyes
Fig. 1 Two views of one courtyard. In each panel the arrow points at the epipole: the image, in this picture, of the eye that took the other one. It is computed from the 44 correspondences alone, as the null vector of a fundamental matrix that has never been shown a camera, and it lands on the projection of the other eye to 1.1e-9 px on the left and 3.7e-10 px on the right.

That number is the whole essay. The rest is what it means and why it is worth a figure rather than a sentence.

Where the point comes from

The eye that took the right-hand picture is a point in the world. Points in the world have images: that is what a camera does, and it does it to every point in front of it whether or not anything is there. So the right-hand eye has an image in the left-hand picture, in exactly the sense that a lamp post has one — a place on the picture plane where the ray from the left eye to the right eye crosses it.

That place has a name. It is the epipole, and there is one in each picture.

Reasoning about it directly is short and unhelpful. Every ray that leaves the left eye, whatever it is aimed at, lies in a plane with the two eyes. The image of that ray in the right-hand picture is therefore a line, and every one of those lines passes through the right-hand epipole — because every one of those planes contains the right-hand eye. The pencil of all such lines has one point in common, and the common point is where the other eye is.

None of that is hard, and all of it assumes what is being looked for. The interesting version is the reverse: given only a list of matched points, produce the epipole, and then check it against the camera position that was never supplied.

What the computation is given

The correspondences are the whole input. Forty-four points in the courtyard are visible in both pictures, so there are forty-four pairs — a position in the left picture and a position in the right — and nothing else crosses into the computation. No focal length, no camera position, no orientation, no scene coordinates.

That restriction is enforced by a file boundary rather than by discipline. lib/stereo.js has a line in it, marked in the source, and everything below the line takes image coordinates. The two functions that see cameras sit above it, are labelled ground truth, and exist to be compared against. This is the same arrangement lib/projective.js has had since the single-view round trip was written, for the same reason: a recovery computed with the answer in scope is not a recovery, it is a redrawing, and the difference is invisible in the resulting picture.

The correspondences themselves are supplied by construction — one world point projected into two cameras. That is a deliberate limit on what this field is about, and it is worth stating early because it will keep coming up. Nothing here matches anything. Finding which mark in the left picture goes with which in the right is a large and genuinely difficult subject, and it is a different one; every argument in this field survives with every correspondence handed over exactly, which is the test that separates the geometry from the matching.

The matrix in the middle

The route from a list of correspondences to the epipole runs through a 3×3 matrix.

For any pair of matched image points x\mathbf{x} and x\mathbf{x}', written as homogeneous three-vectors, there is a matrix FF with

xFx=0\mathbf{x}'^{\top} F \mathbf{x} = 0

for every pair. It is called the fundamental matrix, and the constraint is one linear equation in the nine entries of FF per correspondence. Eight correspondences therefore determine FF up to scale, which is all that a homogeneous constraint can determine, and the name of the classical method — the eight-point algorithm — comes from that count.

What matters here is not how FF is found but what happens once it exists. FF has rank two, so it has a null vector: some e\mathbf{e} with Fe=0F\mathbf{e} = 0. Feed that into the constraint and it says xFe=0\mathbf{x}'^{\top} F \mathbf{e} = 0 for every x\mathbf{x}' — every point in the right-hand picture, without exception.

A point in the left picture whose constraint is satisfied by every point in the right picture is a point that says nothing about where its match is. There is exactly one such point, and it is the epipole. Similarly FF^{\top} has a null vector, and that one is the epipole in the right-hand picture.

So the epipole is not computed by a special procedure. It falls out of the null space of a matrix that was fitted to matched marks, and it is the direction in which the fitting has nothing left to say.

Why the check is the point

Here is the arrangement the figure makes, in full.

Two cameras are built with stated positions. The courtyard is projected into both, producing forty-four pairs. The pairs are handed to a routine that has never seen a camera. It fits FF, takes its null space, and returns two points.

Separately — and never in the same scope — each camera is asked to project the other camera’s eye, which is a world point like any other. That gives two more points.

They are the same points, to about a billionth of a pixel.

There is no way for that to happen by accident. The recovered epipole depends on forty-four pairs of numbers; the projected eye depends on two camera positions and two focal lengths. The only thing connecting them is that the correspondences were produced by those cameras, and the agreement says the epipolar geometry encoded in the marks really is the geometry of the eyes that made them.

The residual — a fraction of a billionth of a pixel — is arithmetic rather than geometry. It is the accumulated rounding of a least-squares fit, a rank enforcement and a null-space extraction in double precision. There is nothing left in it that is about perspective.

The other eye, found in the picture — 1.2 m apartTwo views of one courtyard. In each panel the arrow points at the epipole: the image, in this picture, of the eye that took the other one. It is computed from the 44 correspondences alone, as the null vector of a fundamental matrix that has never been shown a camera, and it lands on the projection of the other eye to 6.1e-9 px on the left and 3.3e-9 px on the right.epipoleepipoleleft pictureright pictureepipole from 44 correspondences vs the projected eye: 6.1e-9 px1.20 m between the eyes
Fig. 2 The same pair of eyes brought to 1.2 m apart. The epipole moves — it is the image of a camera that is now somewhere else — and it is still recovered from the correspondences alone, still landing on the projection of the other eye. Nothing about the fit changed except the arrangement it was measuring.

The matrix belongs to the cameras, not to the courtyard

One property of FF is easy to state and easy to underrate: it does not depend on the scene at all.

The derivation makes this obvious in hindsight. FF is built out of the two cameras’ calibrations, their relative rotation and the direction of the baseline between them. Nothing about what is being photographed enters. Two photographs of a courtyard and two photographs, from the identical pair of positions, of a completely different courtyard have the same fundamental matrix.

The consequence is that the forty-four correspondences are not forty-four separate facts being averaged into a compromise. They are forty-four measurements of one object with seven degrees of freedom, and each of them constrains it in the same way. That is why eight suffice, and why the forty-fifth adds precision rather than complexity.

It also explains the shape of the failure when a correspondence is wrong. A mismatched pair is not a point that happens to be in an awkward place; it is a measurement of a different matrix, spliced into a list of measurements of this one. A least-squares fit has no way to notice that and no place to put it except spread across the whole answer, which is why one bad match damages every point rather than the region around itself.

And it is why the epipolar constraint is a genuine test rather than a restatement. Nothing in the fitting of FF used the fact that these particular marks came from a courtyard, so when a forty-fifth point drops onto the line its partner predicts, that is a fact about the cameras being confirmed by a point that took no part in establishing it.

The epipole is usually not on the picture

Look at the figure again and notice that neither epipole is drawn as a dot on the courtyard. Both are arrows pointing off the edge.

At 2.6 m apart, with the cameras aimed at the same point in the courtyard, the right-hand eye is far outside the left camera’s field of view. Its image is therefore a point on the picture plane that lies well outside the picture frame — a perfectly good point, at coordinates that run into the thousands on a 690-pixel canvas.

This is the ordinary case, not a special one. Two photographs taken from positions a few metres apart, both aimed at the same subject, will almost always have their epipoles far off-frame, because seeing the other camera in shot requires pointing roughly at it. The exception is the rectified pair, where the two cameras face the same direction and the epipoles go off to infinity in the horizontal direction — a case common enough and useful enough to have its own field of arithmetic.

The habit worth carrying is that a projective point being off-canvas is not a failure. This site has met it before: the vertical vanishing point that the height recovery uses sits at y = 7.2 × 10⁹ on a 420-pixel canvas and the method is exact anyway, because it parameterises along a line rather than evaluating at a point. The routines here are written the same way — the epipole is returned as a direction with a flag when its third homogeneous coordinate vanishes, rather than divided through and reported at 10¹⁶.

A point on the left is a line on the rightFive points in the left picture. Each one fixes a line in the right picture — the image of the ray it came along — and its match lies on that line to 4.5e-14 px. The five lines meet at the epipole, 3.5e-11 px from concurrent. Knowing where a point is in one picture does not say where it is in the other; it removes one of the two degrees of freedom.123123a point is chosen hereand must be on this linematch to its own epipolar line: 4.5e-14 px3 of 44 correspondences drawn
Fig. 3 Three of the same marks, with the lines their partners must lie on. Every one of those lines runs to the epipole, which is the previous figure’s point restated as a property of the whole pencil rather than of one ray.

What the epipole is good for

Three things, in ascending order of usefulness.

It says whether two pictures are of the same scene from different places. If they are two frames from a camera that only turned, there is no baseline, no epipole in the ordinary sense, and the whole apparatus degenerates. That degeneracy has a measurable approach rather than a cliff, and a whole essay about why the failure is in the reading rather than in the algebra.

It organises the search for matches. Every point in the left picture has a line in the right picture that its match must lie on, and every one of those lines passes through the epipole. That turns a two-dimensional search into a one-dimensional one, which is the next essay and is the single most useful consequence the field has.

And it is the direction of the baseline, in the picture’s own coordinates. The line from one eye to the other images to a point, and that point is the direction the photographer moved, read off the photograph. Combined with a focal length it gives the direction of the second camera in the first camera’s frame — which is most of the pose, and the rest of it needs one further step and one assumption.

The camera, written as a matrix

One piece of machinery had to be built before any of this, and it is worth a paragraph because everything in three fields rests on it.

This site’s camera is specified the way a photographer would specify one: an eye, a target, an up direction, and a focal length or a field of view. Multi-view geometry is written in terms of a 3×4 matrix P=K[Rt]P = K[R \mid \mathbf{t}]. Those are the same camera, and “the same” has to be a measurement rather than an assurance.

The site's camera, written as the matrix multi-view geometry needsK holds the focal length and the principal point; R's rows are the camera basis — right, down, forward — and t is −R·eye. Projecting all 44 scene points through P = K[R|t] and through the camera itself gives the same picture to 1.8e-13 px. Everything in this field rests on the two being one camera, so it is measured rather than assumed.K — focal length and principal point739.90345.00739.9200.0001.0000R — right, down, forward0.980000.1991-0.0182-0.99580.08970.1982-0.0915-0.9759t = −R·eye00.99586.6497focal 739.85 px · 50.0° acrossP projects 44 points where the camera does, to 1.8e-13 pxcorrect from 17 cm, at 160 mm wide50° across
Fig. 4 K holds the focal length and the principal point; R’s rows are the camera basis — right, down, forward — and t is −R·eye. Projecting all 44 scene points through P = K[R|t] and through the camera itself gives the same picture to 1.8e-13 px. Everything in this field rests on the two being one camera, so it is measured rather than assumed.

The rows of RR are the camera’s own basis vectors, because projecting a point in lib/camera.js is exactly three dot products with them. That includes the site’s down vector, which is forward × right rather than the other order — a sign that was wrong for a whole phase and imaged the ground above the horizon. A matrix written from those three vectors is right by construction. A matrix written from a remembered convention is right by luck, and the difference between the two shows up as a picture that looks plausible and is mirrored.

The measured agreement is 1.8 × 10⁻¹³ px over forty-four points from two cameras. That is the floor, and it means the matrix form introduces nothing.

How far apart the eyes were, read out of the two picturesThe eight-point system's second-smallest singular value against the distance between the cameras, over a range of 100×. The fitted slope is 0.885, short of proportional because a sweep this wide reaches the range where the two views stop being a small perturbation of one another — with every point within 0.085 of a decade of the line. Nothing in the computation knows where either camera was: this is a distance in the world, recovered from ink.-3-2.50-2-1.50-1-0.50000.500baseline between the eyes (m, log scale)σ₈ / σ₁ of the design matrix — computed from the two pictures aloneslope 0.88log–log slope 0.885, worst residual 0.085 decades50 mm to 5 m
Fig. 5 The one thing about the two eyes’ separation that the pictures do supply, over a hundredfold range — a quantity proportional to it, computed from the marks. What they do not supply is which metre it is measured in.

What two pictures have not yet bought

It is worth being precise about how little has been established.

The epipole is one point. It fixes the direction from one eye to the other, in the first camera’s frame, and it does not fix the distance. Nothing so far says how far apart the cameras were, how the second one was turned, or where anything in the courtyard is.

Those come next, and they come with qualifiers. The rotation and the direction of the baseline are recoverable exactly from correspondences and a focal length. The length of the baseline is not recoverable at all, from any number of correspondences, and neither is the size of the courtyard — which is the single-view scale ambiguity surviving the addition of a second camera entirely intact.

That survival is the thing this field keeps returning to. A second picture is a large addition: it turns ratios into a three-dimensional shape, turns a ray into a point, and puts the other camera on the paper. It does not turn a shape into a size. Two eyes 65 mm apart do not know they are 65 mm apart, and nothing they see will tell them.

One reconstruction, drawn at its own scale and at 1.7×The courtyard recovered from two pictures, seen from above. Every pairwise distance ratio matches the world's to 8.1e-14, so the shape is exact. The size is not determined at all: the right-hand plan is the same reconstruction 1.7 times larger and fits the same two pictures equally well. One measured length in the scene — here 0.800 m — fixes it, and nothing in the pictures can.as recovered0.400 across× 1.7 — same two pictures0.680 acrossworst ratio deviation 8.1e-14size fixed only by a supplied 0.80 m
Fig. 6 Where the field ends up. Two pictures, a courtyard in plan, and the same courtyard drawn 1.7 times larger fitting them equally well — the epipole above is the first step toward this, and the size is what neither step supplies.

The habit, restated for two cameras

The site’s standing discipline is that every figure is projected from a stated camera and every recovery is checked against something it was not given. Doubling the number of cameras doubles the opportunities to cheat, and the two that matter are worth naming.

A reconstruction computed with the true poses in scope is a redrawing. It will reproject perfectly, it will look like a scene, and it will prove nothing. The defence is the file boundary described above, and it is checkable: the recovery functions take arrays of image coordinates, and there is no path from them to a world point.

And a comparison made without removing the freedom is meaningless. The reconstruction is only determined up to a similarity, so comparing recovered positions with true ones directly reports the arbitrary choice of frame as though it were error. Every comparison in these three fields removes that freedom first — pairwise distance ratios here, an aligned track in the many-view field — and the removal is done by a named function rather than by eye.

Both traps produce the same symptom, which is a number that is far too good or far too bad for reasons that have nothing to do with the geometry. The epipole check in this essay is designed to be immune to both: it compares two computations of one point, in pixels, in a frame both of them already live in.

Two pictures, forty-four matched marks, and the other camera falls out of them. That is where the field starts.

What links here

Computed from the collection, not written here: the essays that point at this one.

Reads more easily once this is understood

Essays that name this one as worth reading first.

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.

BaselineCamera matrixCorrespondenceEpipolar geometryEpipoleFocal lengthFundamental matrix