Epipolar geometry is the projective geometry between two views of the same scene, which states that a point seen in one image must appear somewhere along a specific line, the epipolar line, in the other image. In computer vision, it is the mathematical foundation of stereo matching, structure from motion and 3D reconstruction, because it turns a two-dimensional search for correspondences into a one-dimensional one.
The relationship depends only on the relative pose of the two cameras and their internal parameters, not on what the scene contains. It is captured compactly by the fundamental matrix for uncalibrated cameras and the essential matrix for calibrated ones, both of which can be estimated directly from matched image points.
How the epipolar constraint arises
The epipolar constraint arises because a 3D point, the two camera centers and the two image points all lie in one plane, called the epipolar plane. The line joining the camera centers is the baseline. Wherever the baseline pierces an image plane, it creates the epipole, which is the image of the other camera center.
Every epipolar plane intersects each image in a line, and all epipolar lines pass through the epipole. When a pixel is selected in the left image, the ray through that pixel sweeps out a line in the right image. The true match must lie on that line, which is why the property is often called the epipolar constraint.
The table below lists the geometric elements that every two-view configuration contains.
| Element | Definition | Role in matching |
|---|---|---|
| Baseline | Segment joining both camera centers | Sets depth sensitivity |
| Epipole | Projection of one camera center into the other image | Common point of all epipolar lines |
| Epipolar plane | Plane through the 3D point and both centers | Links the two rays |
| Epipolar line | Intersection of the epipolar plane with an image | Search region for the match |
| Correspondence | Pair of image points from one 3D point | Input for estimation |
The fundamental and essential matrices
The fundamental matrix F is a 3×3 matrix of rank 2 that encodes epipolar geometry in pixel coordinates. For any corresponding points x and x’, expressed in homogeneous coordinates, it satisfies the bilinear equation x'ᵀ F x = 0. The product F x gives the epipolar line in the second image directly.
The essential matrix E expresses the same constraint in normalized camera coordinates, after the intrinsic calibration matrices K and K’ have been removed. It factors as E = [t]× R, where R is the relative rotation and t the translation direction. Because of this factorization, E has two equal nonzero singular values and only five degrees of freedom.
The following comparison shows how the two matrices differ in practice.
| Property | Fundamental matrix | Essential matrix |
|---|---|---|
| Coordinates | Pixel coordinates | Normalized coordinates |
| Calibration needed | No | Yes, intrinsics known |
| Degrees of freedom | 7 | 5 |
| Minimal solver | Seven-point algorithm | Five-point algorithm |
| Recovers pose | Only up to projective ambiguity | Rotation and translation direction |
Neither matrix recovers the absolute scale of translation. Two images alone cannot tell a small object nearby from a large object far away, so scale must come from a known baseline, an object of known size or another sensor such as an inertial unit.
Estimating epipolar geometry from images
Estimation starts with feature matching: detectors such as SIFT, ORB or learned keypoint networks find candidate correspondences between the two images. Because a share of these matches is always wrong, the solver runs inside RANSAC or a related robust estimator that keeps the model supported by the most inliers.
The classic normalized eight-point algorithm solves a linear system and then enforces rank 2. Hartley normalization, which centers and scales the points before solving, is essential, because without it the linear system is badly conditioned and results degrade sharply. The final model is usually refined by minimizing the Sampson error or the geometric reprojection error.
Each algorithm suits a different situation, as summarized below.
| Method | Minimum points | Typical use |
|---|---|---|
| Eight-point algorithm | 8 | Simple linear estimate of F |
| Seven-point algorithm | 7 | Minimal F solver inside RANSAC |
| Five-point algorithm | 5 | Essential matrix for calibrated cameras |
| Nonlinear refinement | All inliers | Final accuracy after robust fitting |
Rectification and stereo depth
Stereo rectification warps both images with homographies so that epipolar lines become horizontal and aligned row by row. After rectification, a matching pixel lies on the same image row, and the horizontal offset between the two positions is the disparity.
Depth follows from the relation Z = f · B / d, where f is the focal length in pixels, B the baseline and d the disparity. This formula explains a key trade-off: a longer baseline improves depth precision at distance, but it also increases occlusions and makes matching harder because the two views look more different.
The table connects typical configurations with their behavior.
| Configuration | Baseline | Effect on depth |
|---|---|---|
| Handheld depth module | 1 to 5 cm | Good near range, poor far range |
| Automotive stereo camera | 12 to 30 cm | Usable to tens of meters |
| Aerial photogrammetry | Tens to hundreds of meters | Precise terrain models |
| Pure rotation | Zero | No depth information |
Degenerate cases and common mistakes
Epipolar geometry is not defined when the baseline is zero. A camera that only rotates produces images related by a homography, and any fundamental matrix fitted to such data is meaningless. A similar degeneracy occurs for planar scenes, where many fundamental matrices fit the points equally well.
- Skipping point normalization in the eight-point algorithm, which produces unstable estimates.
- Ignoring lens distortion, which bends epipolar lines into curves and breaks the linear model.
- Treating the recovered translation as metric, although scale is unobservable from two views.
- Using too few or clustered matches, which leaves the epipole poorly constrained.
- Accepting a model without checking inlier ratio and residuals, which hides wrong solutions.
Robust pipelines detect these cases by comparing a homography model with a fundamental matrix model and choosing the one that explains the data better, a test used in many visual SLAM systems.
The simple explanation
Imagine two people photographing the same statue from different spots. If you point at a spot on the statue in the first photo, you do not have to search the whole second photo for it. It must lie on one line in the second photo.
That rule is epipolar geometry. It comes from the positions of the two cameras alone. Computers use it to find matching points quickly. Once the matches are known, they can measure how far away things are, much like human eyes judge depth.
How it is used in practice
A team building a driver assistance system mounts two cameras 20 cm apart behind a car windshield. After calibration, the software computes the essential matrix and rectifies every frame pair, so matching pixels always share the same row. The stereo matcher then searches only along that row, which cuts the matching work by orders of magnitude compared with a full image search.
With a focal length of about 1,400 pixels, a disparity of 14 pixels corresponds to a depth of roughly 20 meters. The system updates a dense depth map at 30 frames per second and flags obstacles in the lane. When a windshield replacement shifts one camera slightly, the epipolar error rises above one pixel, and an automatic recalibration routine restores accurate depth before the car leaves the service center.