Epipolar Geometry
Imagine two photographs of the same statue, taken from different viewpoints. You must find which pixel in image two corresponds to a given pixel in image one. Naively this is a search over the entire second image — millions of candidate matches. Epipolar geometry collapses this search to a single line. This works because the geometry of two pinhole cameras guarantees something useful. Any correspondence for a point must lie along a very specific one-dimensional locus. This single fact underlies stereo depth estimation, structure from motion, and visual SLAM. It also underlies multi-view 3D reconstruction pipelines used in robotics, autonomous driving, and photogrammetry. The core insight is purely projective. A 3D point, together with the two camera centers, defines a plane in space. This is called the epipolar plane. That plane slices through each image as a line — the epipolar line. The corresponding point in the other image must lie exactly on it. This constraint does not require knowing the 3D point's depth. It is a constraint that exists before any 3D reconstruction happens. That is why it is so useful for pruning bad matches. It also helps in verifying camera geometry and initializing reconstruction algorithms. This article builds the geometry from scratch: the epipoles, epipolar lines, and epipolar plane. It then formalizes the constraint algebraically. This is done through the essential matrix (calibrated cameras) and the fundamental matrix (uncalibrated cameras). We derive the famous relation . We show how to estimate from point correspondences via the eight-point algorithm. We also explain why normalization and rank-2 enforcement are not optional details. They are the difference between a usable algorithm and a numerically useless one. By the end you will be able to explain, derive, and implement the estimation of and . You will be able to decompose into camera motion. You will understand precisely why RANSAC is essential when doing this from noisy real-world correspondences. This machinery is the direct algebraic gateway to Stereo Vision and Depth and Structure from Motion. Both of these assume the constraints developed here.
- Two calibrated (or uncalibrated) camera views of a 3D point create an epipolar plane, projecting to matching epipolar lines in each image.
- The fundamental matrix (uncalibrated) and essential matrix (calibrated) algebraically encode this constraint: .
- has 7 degrees of freedom and rank 2; has 5 degrees of freedom and two equal nonzero singular values.
- The eight-point algorithm estimates linearly from ≥8 correspondences, with coordinate normalization crucial for numerical stability.
- can be decomposed via SVD into four candidate (rotation, translation) pairs; a single point disambiguates via a chirality (positive-depth) check.
- RANSAC is used in practice because real correspondences contain outliers that would otherwise corrupt the linear least-squares estimate.
Two views of the same 3D point are geometrically tied to a single line — not a search region — in the other image, and this constraint is captured algebraically by a rank-2, 3×3 matrix.
The idea
Consider two pinhole cameras with optical centers and , viewing a 3D point . The three points , , and define a plane in space, called the epipolar plane . This plane intersects image plane in a line and image plane in a line ; these are the epipolar lines. Crucially, the image of in the first camera, , lies on , and its correspondence in the second camera lies on — for every choice of along the ray through . The line joining the two camera centers, called the baseline, pierces each image plane at a special point: the epipole. The epipole in image is the projection of the other camera's center ; the epipole in image is the projection of . As the 3D point varies, the epipolar plane rotates about the baseline, but every epipolar line in image still passes through the fixed epipole , and likewise every epipolar line in passes through . This gives a pencil of epipolar lines through each epipole — a one-parameter family indexed by depth of . The algebraic object encoding this entire geometric picture is a matrix. When camera intrinsics are known and image coordinates are normalized (rays in camera coordinates), the relevant matrix is the essential matrix , which depends only on the relative rotation and translation between the two cameras:
where is the skew-symmetric matrix representing the cross product with . When working directly in pixel coordinates (uncalibrated or unknown intrinsics), the relevant matrix is the fundamental matrix , related to by the intrinsic calibration matrices of the two cameras:
Both matrices satisfy the same defining relation for corresponding points (in homogeneous pixel or normalized coordinates respectively):
This is the epipolar constraint. Geometrically, is the epipolar line in the second image (a line represented as a homogeneous 3-vector with equation ); the constraint simply says lies on that line. The epipoles themselves are the left and right null spaces of : and , since the epipole lies on every epipolar line in its own image.
How it works
Estimating from correspondences: the eight-point algorithm. Given point correspondences , each satisfies . Writing , , and stacked as a 9-vector , this becomes one linear equation per correspondence:
Stacking such rows gives , an homogeneous linear system. Since is only defined up to scale, we solve for the unit vector minimizing subject to — the solution is the right singular vector of corresponding to its smallest singular value. A raw solution from this linear system will generically have full rank 3, but a valid fundamental matrix must be rank 2 (because it maps points to lines through a fixed epipole — a rank-3 matrix would have no null space, meaning no epipole would exist). We enforce this by taking the SVD , zeroing the smallest singular value, and reconstructing . This is the closest rank-2 matrix to in Frobenius norm (Eckart–Young theorem), so it is the best rank-2 correction consistent with the data. Numerical conditioning is not cosmetic. Raw pixel coordinates (e.g. values around 500–2000) produce columns of that differ by orders of magnitude (products like versus constants like ), making the SVD ill-conditioned. The normalized eight-point algorithm (Hartley) translates and scales points in each image so the centroid is at the origin and the average distance to the origin is , solves for in normalized coordinates, then un-normalizes. This single preprocessing step is often the difference between an unusable and a highly accurate estimate. ``` ALGORITHM: Normalized Eight-Point for Fundamental Matrix INPUT: correspondences {(x_i, x_i')}_{i=1..n}, n >= 8 OUTPUT: fundamental matrix F (3x3, rank 2) 1. Normalize points in each image independently: T = similarity transform: centroid -> origin, mean dist -> sqrt(2) T' = similarity transform for the second image x_hat_i = T x_i x_hat'_i = T' x'_i 2. Build the n x 9 measurement matrix A: for i = 1..n: (u, v) = x_hat_i[0:2] (u',v') = x_hat'_i[0:2] A[i] = [u'u, u'v, u', v'u, v'v, v', u, v, 1] 3. Solve A f = 0 via SVD(A) = U S V^T f = last column of V (smallest singular value) F_hat = reshape(f, 3, 3) 4. Enforce rank-2 constraint: U2, S2, V2^T = SVD(F_hat) S2[2,2] = 0 // zero the smallest singular value F_hat = U2 diag(S2) V2^T 5. Denormalize: F = T'^T F_hat T RETURN F ```
From or to camera motion. When intrinsics are known, we recover and enforce its special structure: must have singular values for some (equivalently, project 's singular values to up to scale). Decompose ; then, using
the four candidate motions are , where is the third column of (up to overall unknown scale, since monocular two-view geometry cannot recover absolute scale). Exactly one of these four places the triangulated 3D point in front of both cameras — the chirality check — and that combination is the true relative pose.
Using the constraint for matching and verification. In practice, epipolar geometry is used two ways: (1) as a search restriction, matching a feature in image 1 only to features near the corresponding epipolar line in image 2, and (2) as a consensus test inside RANSAC, where hypothesized or matrices are scored by how many correspondences satisfy the epipolar constraint within a small tolerance (the Sampson distance or symmetric epipolar distance), rejecting mismatches from feature detectors like SIFT or ORB. ``` ALGORITHM: RANSAC for Fundamental Matrix Estimation INPUT: putative correspondences (from feature matching, contains outliers) OUTPUT: F, inlier set best_inliers = {} for iter in 1..max_iterations: sample = random 8 correspondences (or 7 for minimal solver) F_candidate = EightPoint(sample) inliers = {} for each correspondence (x, x') in all correspondences: d = SampsonDistance(F_candidate, x, x') if d < threshold: inliers.add((x, x')) if |inliers| > |best_inliers|: best_inliers = inliers best_F = F_candidate F_final = EightPoint(best_inliers) // refit on all inliers RETURN F_final, best_inliers ```
Complexity & correctness
Time and space complexity. Building the matrix takes time and space. The dominant cost is the SVD of (or equivalently the eigendecomposition of , a matrix), which costs for forming plus a constant-time (since the matrix is fixed size ) eigendecomposition — overall for fixed small constant dimension. The rank-2 projection SVD is on a fixed matrix, . So the raw eight-point algorithm is , linear in the number of correspondences — essentially the cost of one pass over the data. Under RANSAC, if the inlier ratio is and the minimal sample size is (7 or 8), the expected number of iterations to find at least one all-inlier sample with confidence is
and each iteration costs (fit + score all points), giving total RANSAC time . Since is small (7–8), shrinks fast as outlier rate grows, which is exactly why the seven-point or eight-point minimal solvers (rather than fitting with many points per iteration) are preferred inside RANSAC — smaller means dramatically fewer iterations needed for the same confidence.
Correctness of the epipolar constraint. The relation follows directly from the coplanarity of . In calibrated (normalized) coordinates, ; more directly, the vectors (ray to from camera 1, in camera 1 coordinates), (baseline, camera 2 relative to camera 1), and (ray to from camera 2, rotated into camera 1's frame) are coplanar because they all lie in the epipolar plane through the two centers and . Coplanarity of three vectors is exactly the vanishing scalar triple product:
which (transposing and relabeling) is the stated constraint with . Since simply changes coordinates from normalized rays to pixels, the same relation holds for in pixel coordinates.
Why rank 2 is necessary and sufficient for validity. has rank 2 because has rank 2 (it is skew-symmetric with in its null space) and , , are full rank; multiplying by full-rank matrices preserves rank. Rank 2 is also sufficient in the sense that any rank-2 matrix (up to scale) is a valid fundamental matrix for some pair of cameras — this is why the SVD-based rank-2 projection step is not an approximation hack but a necessary correctness-restoring projection onto the actual solution manifold, and it is the closest such matrix in Frobenius norm by the Eckart–Young theorem.
Degrees of freedom. is a matrix (9 parameters), defined up to overall scale (−1) and constrained to (rank ≤ 2, another −1 constraint), giving degrees of freedom — hence the existence of a minimal 7-point algorithm (which yields up to 3 real solutions from a cubic constraint). has the same scale ambiguity but the additional structural constraint of two equal singular values, giving degrees of freedom (3 for rotation, 2 for translation direction, since overall scale of is unrecoverable), consistent with the standard parameterization of relative pose up to scale.
Tradeoffs. The eight-point algorithm is linear and thus fast and globally optimal for the algebraic error it minimizes, but algebraic error is not geometrically meaningful — it does not minimize reprojection error. Nonlinear refinement (minimizing Sampson distance or true reprojection error via bundle adjustment style optimization) is typically applied afterward for accuracy. The 7-point minimal solver is more efficient inside RANSAC (fewer samples needed) but requires solving a cubic and disambiguating up to three solutions, adding implementation complexity.
Worked example
Consider two synthetic calibrated cameras with identity intrinsics, camera 1 at the origin looking down , and camera 2 translated by (baseline along ) with no rotation (). Then
Take a 3D point in camera 1's frame. Its normalized image coordinate in camera 1 is . In camera 2's frame, , giving . Check the epipolar constraint:
First compute . Then . ✓ The constraint holds exactly, as expected for noise-free correspondences. Now trace what the epipolar line looks like. , meaning the line equation in image 2 is , i.e. — a horizontal line, matching intuition: since the baseline is purely horizontal () with no rotation, epipolar lines are horizontal, and stereo correspondence search reduces to a 1D scan along constant (this is exactly the "rectified stereo" scenario used in Stereo Vision and Depth). The epipole in image 2 is the projection of camera 1's center into camera 2, i.e. it lies at infinity in the direction of — here is parallel to the image plane, so is a point at infinity along the horizontal direction in homogeneous coordinates, consistent with all epipolar lines being horizontal (a pencil of parallel lines is a pencil through a point at infinity).
| Quantity | Value |
|---|---|
| Baseline | |
| Rotation | |
| Essential matrix | |
| Point (cam 1 frame) | |
| , | , |
| Epipolar constraint value | (exact match) |
| Epipolar line in image 2 | (horizontal) |
| Epipole | at infinity, direction |
Now consider estimating from 8 noisy correspondences via the eight-point algorithm without normalization: pixel coordinates around produce entries like next to constant entries of in the same row of . The condition number of becomes enormous, and the smallest singular vector — meant to capture a subtle geometric signal — gets dominated by numerical noise in the large-magnitude columns. Normalizing coordinates first (centroid at origin, average distance ) rescales all columns of to comparable magnitude, typically improving the estimate's reprojection accuracy by an order of magnitude in practice, which is why every serious implementation includes this step.
Common pitfalls & traps
| Pitfall | Why it happens | Consequence |
|---|---|---|
| Skipping coordinate normalization | Raw pixel coords span vastly different scales in 's columns | Ill-conditioned SVD, garbage estimates |
| Forgetting the rank-2 projection | Linear least squares gives a generic rank-3 solution | No valid epipoles exist; constraint violated for all points |
| Confusing and | Both satisfy similar-looking equations | Using pixel coords with (or vice versa) silently produces nonsense |
| Using all 4 candidate without chirality check | SVD decomposition of is inherently 4-way ambiguous | Wrong camera pose, points reconstructed behind the camera |
| Fitting with plain least squares on noisy matches | No outlier rejection | A handful of mismatches can dominate and destroy the fit |
| Assuming scale is recoverable from two views | Translation direction only, not magnitude, is observable | Absolute scale silently wrong in monocular reconstructions |
| Near-degenerate configurations (pure rotation, planar scene) | becomes ill-defined or a homography suffices instead | Eight-point algorithm becomes numerically unstable or ambiguous |
Pioneers & history
The mathematical treatment of two-view geometry traces back to 19th-century projective geometry, but its modern computer vision formulation crystallized in the late 20th century as multi-view reconstruction became computationally tractable.
Origins · 1 minH. Christopher Longuet-Higgins and how this was discovered
Longuet-Higgins, primarily known for work in theoretical chemistry and cognitive science, introduced the essential matrix and the linear eight-point algorithm for recovering relative camera motion from point correspondences in 1981 — a result that became foundational to structure-from-motion research for decades afterward.
Where this matters
Epipolar geometry is the algebraic backbone of every classical multi-view 3D vision system. In stereo depth estimation, cameras are calibrated and rectified so epipolar lines become horizontal scanlines, reducing correspondence search from 2D to 1D and enabling real-time dense disparity computation used in robotics and autonomous vehicle perception stacks. In structure from motion (SfM) pipelines like COLMAP, Bundler, and VisualSFM, pairwise fundamental or essential matrix estimation (with RANSAC) is the first geometric verification step before triangulating sparse 3D points and running bundle adjustment. In visual SLAM systems (ORB-SLAM and successors), essential matrix estimation initializes monocular pose tracking from the first two keyframes. In augmented reality and photogrammetry, epipolar constraints filter feature matches before mesh reconstruction. Even modern learned correspondence and pose networks are frequently trained or evaluated against ground-truth epipolar geometry, and many hybrid systems still use classical /-matrix estimation as a robust geometric verification layer around learned feature matches.
Ask the tutor: Can you walk through deriving the seven-point algorithm's cubic constraint step by step?
What is the difference between the fundamental matrix and the essential matrix?
The essential matrix relates corresponding points expressed in normalized camera coordinates (i.e., after removing the effect of camera intrinsics), and depends only on the relative rotation and translation between two calibrated cameras. The fundamental matrix relates corresponding points in raw pixel coordinates and additionally absorbs the unknown intrinsic calibration matrices . Both satisfy an equivalent epipolar constraint in their respective coordinate systems. has 5 degrees of freedom (rotation plus translation direction) because its singular values are constrained to be equal; has 7 degrees of freedom since it only needs rank 2. Use when intrinsics are unknown, and when cameras are calibrated and you want to directly recover relative pose.
Why can't absolute scale be recovered from two-view geometry alone?
The essential matrix is invariant to a global scale change on : replacing with scales by the same , but since (like ) is only ever recoverable up to overall scale from the epipolar constraint, any scaled translation is equally consistent with all observed correspondences. Geometrically, doubling the baseline distance and doubling all 3D point depths produces identical image projections. This is the classic scale ambiguity of monocular vision: two-view (and even full monocular sequence) reconstructions are correct only up to an unknown global scale factor, which must be resolved externally — via a known object size, a second calibrated sensor (stereo baseline, IMU, or LiDAR), or GPS-scale constraints in SfM pipelines.
Why does the rank-2 constraint on F matter if a rank-3 estimate already satisfies most correspondences approximately?
A rank-3 matrix has trivial null space, meaning there is no vector with — so no epipole exists, and the pencil-of-lines structure that defines valid epipolar geometry breaks down entirely. Practically, a rank-3 "F" may still approximately satisfy for the noisy points it was fit to, but it does not correspond to any physically realizable pair of cameras, and using it to compute epipolar lines for new points (not in the fitting set) or to decompose into gives meaningless results. Enforcing rank 2 via SVD truncation projects the noisy estimate onto the actual manifold of valid fundamental matrices, and by the Eckart–Young theorem this projection is the closest valid matrix in Frobenius norm to the noisy estimate.
How does epipolar geometry simplify stereo correspondence search?
Without epipolar constraints, matching a pixel from image 1 to image 2 requires searching the entire second image, which is expensive and error-prone due to repetitive textures. Epipolar geometry proves that any true correspondence must lie exactly on a specific line in image 2, reducing search to one dimension. In the common case of a rectified stereo rig (cameras with parallel optical axes and coplanar image planes, baseline along the horizontal axis), the epipoles move to infinity and all epipolar lines become horizontal scanlines with identical row index in both images. This is precisely the setup exploited in Stereo Vision and Depth algorithms, where disparity is computed via fast 1D scanline matching instead of full 2D search.
What happens to epipolar geometry when the scene is planar or the camera undergoes pure rotation?
Both are classic degenerate configurations for the fundamental matrix. If the observed 3D points are coplanar, or if the two cameras differ only by a rotation (no translation, i.e. ), the correspondences are actually related by a 2D projective transformation called a homography, not a well-constrained fundamental matrix — the epipolar constraint becomes underdetermined or the estimated becomes numerically unstable (close to rank 1, or with epipoles ill-defined). Robust SfM and stereo pipelines typically test for this by also fitting a homography model and comparing which model better explains the data (e.g., via a likelihood or inlier-ratio comparison), switching estimation strategy when the scene is suspected to be planar or nearly planar.
Can the eight-point algorithm work with fewer than eight points?
Yes, with additional constraints. Since has only 7 degrees of freedom, a minimal solution needs only 7 correspondences, using the rank-2 constraint () as an extra equation beyond the 7 linear equations from the points. This yields a cubic polynomial in one parameter (from the one-dimensional null space of the 7×9 system spanned by two vectors), producing up to 3 real solutions that must be disambiguated using an 8th point or additional geometric checks. The seven-point algorithm is preferred inside RANSAC precisely because smaller minimal samples require exponentially fewer random samples to guarantee finding an all-inlier set at a given outlier rate, even though it is algorithmically more involved than the plain linear eight-point method.
Is epipolar geometry still relevant given modern deep learning approaches to depth and correspondence?
Yes — epipolar geometry remains foundational even as learned methods dominate raw correspondence and depth prediction. Many state-of-the-art SfM and SLAM systems still use classical /-matrix estimation with RANSAC as a robust geometric verification layer to filter learned feature matches (e.g., from SuperPoint/SuperGlue-style networks) before triangulation and bundle adjustment. Some learned architectures explicitly encode the epipolar constraint as an inductive bias, restricting attention or cost-volume computation to epipolar lines for efficiency and multi-view consistency. Understanding epipolar geometry is also essential background for interpreting differentiable structure-from-motion and neural radiance field pipelines, which implicitly assume the same projective consistency across views.