TL;DR
Two cameras looking at the same scene see the same point in different places. Epipolar geometry says the point in the second image must lie on a specific line, which is fixed by the two cameras alone. A 3 by 3 matrix encodes that rule, so matching a point across views becomes a one-dimensional search along a line.
Where you'll see it: stereo depth estimation, feature matching between photos, and the first step of structure from motion.
Intuition
Hold up two fingers, one in front of each eye, and close one eye at a time. The near finger jumps sideways far more than the far one. Now imagine you know where one fingertip is in the left view and you want to find it in the right view. You do not have to search the whole right image. The fingertip must lie somewhere along one line in the right view, because the point, the two camera centres, and that line all sit in one plane.
That plane is the key object. Take the two camera centres and the 3D point. They define a plane, called the epipolar plane. Each image cuts this plane in a line. The point appears on the line in each image, and the two lines are the epipolar lines. The point where the line from one camera centre meets the other image is the epipole, the place where the other camera appears in this image.
Why does this help? Matching is the expensive part of many vision pipelines, and searching a full image for a match is slow and error-prone. If the geometry is known, the search drops from two dimensions to one. The same geometry also lets a program reject matches that are geometrically impossible, which is useful when many matches are wrong.
flowchart LR P["3D point X"] --> E1["Epipolar plane through both centres and X"] E1 --> L1["Line l in image 1: contains x"] E1 --> L2["Line l' in image 2: must contain x'"] C1["Camera centre 1"] --> E1 C2["Camera centre 2"] --> E1
The math
Use the Pinhole Camera Model. Put camera 1 at the origin with identity orientation, and place camera 2 by a rotation and a translation . A point written in camera 1 coordinates is written in camera 2 coordinates as . Here is the position of camera 1's centre written in camera 2's frame (camera 1's centre is , which maps to ). Write and for the normalised image points, with depth and scaling them onto the image plane at .
The essential matrix
In camera 2 coordinates, the vectors , and all lie in the epipolar plane. The triple product of coplanar vectors is zero. Writing for the matrix that computes the cross product with (so ), the coplanarity of , and gives
Since and are scalar multiples of and , the scalars drop out and we get the constraint in image coordinates.
For a pair of calibrated cameras with relative pose , the essential matrix is . Corresponding normalised image points satisfy
Some facts follow directly. is a matrix with rank 2, because has rank 2 and is invertible. Its two nonzero singular values are equal. It has 5 degrees of freedom: 3 from the rotation and 2 from the direction of the translation, since the length of cannot be recovered from images alone.
The fundamental matrix
Real cameras have pixel coordinates , where is the intrinsic matrix from the pinhole lesson. Substituting gives the constraint in pixels.
Here and are the intrinsic matrices of the two cameras. works directly on pixel coordinates and needs no calibration.
is also rank 2 and defined only up to scale, so it has 7 degrees of freedom.
Epipolar lines and epipoles
Fix a point in image 1. The set of image-2 points satisfying is a line, with coefficients . The line is written as in image-2 coordinates. The match of must lie on it. In the other direction, is the epipolar line in image 1 for a point in image 2.
The epipoles are where all epipolar lines meet. The epipole in image 1 is the null vector with , and the epipole in image 2 is with . Geometrically, is where camera 1's centre appears in image 2.
Estimating F from matches
Each pair gives one linear equation in the nine entries of . Nine unknowns up to scale need eight equations, which gives the classic eight-point algorithm. Stack the equations into a matrix , take the singular vector of with the smallest singular value, reshape it into a matrix, and then force rank 2 by setting the smallest singular value of that matrix to zero. Normalising the pixel coordinates before solving, as Hartley showed in 1997, is essential for numerical stability.
Recovering the pose from E
If is known, the SVD gives the relative pose up to a four-way ambiguity. With , the rotation is or , and the translation direction is the last column of . Only one of the four combinations puts the triangulated points in front of both cameras, and that check resolves the ambiguity. The translation length stays unknown, so a real reconstruction fixes the scale with another measurement.
Worked examples
Use normalised coordinates, so . Let camera 2 be translated sideways with no rotation: and .
- Write for . The cross product gives , so .
- Since , .
- Take the 3D point . In camera 1, .
- In camera 2, , so .
- Compute . This is the epipolar line in image 2, read as , which is .
- Check the constraint: . The match lies on the line.
- The epipole satisfies , so . It is a point at infinity in the direction of , so the epipolar lines are parallel. Every line is horizontal.
Interpretation: when the cameras move sideways, the epipolar lines are horizontal rows. A match in image 2 must sit in the same row as its partner in image 1. This is why stereo rectification rotates the images so that the epipolar lines become rows.
Take the same sideways motion, but now the cameras have intrinsic matrix , so . The fundamental matrix is . Scaling the rows and columns of by where they touch the first two coordinates gives
- Take a pixel in image 1. Compute .
- The line is , so . Every match of lies in row 50 of image 2.
- A candidate match gives , so it is consistent.
- A candidate is off the line. The distance from a point to a line is . Here it is pixels.
Interpretation: the epipolar test does not need the 3D point. It only needs , and it gives a distance in pixels. A RANSAC step that keeps matches within a few pixels of their epipolar lines removes most wrong matches without knowing the scene.
Tradeoffs and failure modes
Epipolar geometry is exact for a rigid scene viewed by two pinhole cameras. Its weaknesses come from what it assumes.
| Situation | What goes wrong | Better choice |
|---|---|---|
| Moving objects in the scene | Matches on moving objects violate the rule and are rejected | Robust estimation with RANSAC, or a motion-aware model |
| Points that lie on one plane | The eight-point system becomes degenerate and is not unique | Homography for planar scenes, or a model with more views |
| Pure rotation of the camera | The baseline is zero, so the epipolar lines do not constrain depth | Use the homography between views, or ignore depth |
| Noisy or poorly spread matches | The rank-2 projection is unstable, and shifts badly | Normalise coordinates, use RANSAC, then refine nonlinearly |
| Only the rotation and direction of motion needed | Full has extra parameters | Essential matrix with known intrinsics |
A common mistake is to use the essential matrix when the cameras are uncalibrated. needs known . Without calibration, use and accept that the pose is only known up to a projective transformation.
History
Christopher Longuet-Higgins published a method in 1981 for recovering the relative pose of two views from eight point correspondences, which is the first form of the essential matrix. Later work by Olivier Faugeras and by Quang-Tuan Luong in the early 1990s introduced the fundamental matrix for uncalibrated cameras. Richard Hartley showed in 1997 that normalising the coordinates makes the eight-point algorithm reliable, and the approach became the standard starting point for two-view reconstruction. Hartley and Andrew Zisserman's textbook on multiple-view geometry collected these results and is the usual reference.
Check yourself
QuestionWhy does the essential matrix have rank 2 rather than rank 3?Show answer
It is the product . The cross-product matrix has rank 2, because its null space is the direction itself. Multiplying by an invertible rotation keeps the rank at 2. Geometrically, is always an epipolar line, and all epipolar lines pass through the epipole, so the outputs of fill only a 2-dimensional space.
QuestionA fundamental matrix gives the epipolar line in image 2 for a point in image 1. Which of the points and could be its match, if the match must lie on the line ?Show answer
Check each point in the line equation. For : , so it lies on the line and could be the match. For : , so it also lies on the line. Both are consistent with the geometry, and the epipolar constraint alone cannot choose between them. Another cue, such as the appearance of the patch around each point, is needed to decide.
QuestionWhy can the essential matrix give the translation direction but not its length?Show answer
The constraint depends only on the direction of . Scaling by any positive number leaves the constraint unchanged. A bigger baseline and a farther scene can produce the same image pair, so the images carry no information about the length. A known distance, such as a measured baseline or a known object size, is needed to set the scale.
QuestionApplied: you are building a stereo matcher for two rectified photos from a camera with a 60 mm baseline. Why does rectification make the search easier, and what do you check first?Show answer
Rectification rotates both images so that the epipolar lines become horizontal rows, and each point's match lies in the same row of the other image. The search drops from two dimensions to one, along a short horizontal range. Before relying on it, check that the rectification is accurate: a vertical error of even one or two pixels pushes matches off their rows and makes the disparity search fail. Verify that matched features sit on the same row to within that tolerance.
Sources
- Epipolar geometry, Wikipedia: https://en.wikipedia.org/wiki/Epipolar_geometry
- Essential matrix, Wikipedia: https://en.wikipedia.org/wiki/Essential_matrix
- Eight-point algorithm, Wikipedia: https://en.wikipedia.org/wiki/Eight-point_algorithm