Fundamental Matrix of Two Camera Views
The fundamental matrix is the 3 by 3 table that encodes how two uncalibrated cameras sit relative to each other. It turns a pixel in one image into a search line in the other, and the true match always scores zero.
Why Does This Exist?
Matching a pixel across two views by searching the whole second image is slow and ambiguous. Epipolar geometry cuts the search to one line, and the fundamental matrix is that line in algebraic form, needing no calibration data at all. It is the workhorse behind uncalibrated reconstruction: estimate from matches, then recover cameras and structure. The stereo-flavored tour is epipolar geometry and stereo matching; this page is the matrix itself. Its calibrated sibling is the essential matrix.
Think of It Like This
Two witnesses, one lineup
Witness A says the suspect stood third from the left. Witness B, standing elsewhere, cannot reuse "third from the left," but A can draw B a sight-line across the lineup room: the suspect must stand somewhere along that line. B still has to look, yet the search collapses from a room to a line.
is the written sight-line rule between two cameras. The analogy stops at recognition: the line says where to look, while appearance matching along it remains its own problem.
How It Actually Works
For corresponding homogeneous pixels and , the epipolar constraint reads . Here is with rank : its left and right null spaces are the two epipoles, which is why every epipolar line passes through its epipole. Counting freedoms gives (global scale) (rank constraint) degrees of freedom, so seven point pairs determine in principle.
In practice the -point algorithm stacks one linear row per match and solves by SVD, then projects the answer onto rank by zeroing its smallest singular value. RANSAC wraps the solver to survive mismatches. With intrinsics and known, upgrades to , the subject of the next page.
Worked numbers
Pure translation along the axis gives with rows , , . Take :
so the epipolar line is , the horizontal line . The true match lies on it, and the constraint confirms:
A wrong match such as would score , nonzero and therefore rejected.
Code
def epipolar_residual(xp: tuple[float, float, float], x: tuple[float, float, float]) -> float: f = ((0.0, 0.0, 0.0), (0.0, 0.0, -1.0), (0.0, 1.0, 0.0)) # pure x translation lx = [sum(f[r][c] * x[c] for c in range(3)) for r in range(3)] # l' = F x return sum(xp[r] * lx[r] for r in range(3)) # x' dot l', zero at a true match
print(epipolar_residual((5.0, 1.0, 1.0), (2.0, 1.0, 1.0))) # -> 0.0Watch Out For
Estimating F from a flat scene
If every matched point lies on one plane, a homography explains all matches and becomes degenerate: the solver returns confidently with tiny residuals while the epipolar lines are fiction. Symptoms are plausible RANSAC scores with absurd geometry. Test a homography first on suspiciously flat scenes, and estimate the plane map instead, as homography estimation does.
Skipping the rank-2 projection
The raw -point answer is full rank because of noise, but a true fundamental matrix has a zero singular value. Without zeroing the smallest one, epipolar lines systematically miss their matches by a few pixels and downstream triangulation inherits the bias. One SVD truncation fixes it: solve, decompose, zero, rebuild.
The Quick Version
- The fundamental matrix encodes uncalibrated two-view geometry in one rank-2 matrix.
- The epipolar constraint tests any candidate match algebraically.
- has degrees of freedom: nine entries minus scale minus the rank constraint.
- The -point algorithm plus SVD rank projection is the standard estimator.
- With known intrinsics, upgrades to the essential matrix via .
- Flat scenes make degenerate; a homography owns that case instead.