Skip to content
AI360Xpert
Beta

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.

F turns a left pixel into a right epipolar line; the true match makes x transpose F x equal zero
F turns a left pixel into a right epipolar line; the true match makes x transpose F x equal 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 FF is that line in algebraic form, needing no calibration data at all. It is the workhorse behind uncalibrated reconstruction: estimate FF 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.

FF 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 xx and x′x', the epipolar constraint reads x′TFx=0x'^T F x = 0. Here FF is 3×33 \times 3 with rank 22: its left and right null spaces are the two epipoles, which is why every epipolar line passes through its epipole. Counting freedoms gives 9−19 - 1 (global scale) −1- 1 (rank constraint) =7= 7 degrees of freedom, so seven point pairs determine FF in principle.

In practice the 88-point algorithm stacks one linear row per match and solves by SVD, then projects the answer onto rank 22 by zeroing its smallest singular value. RANSAC wraps the solver to survive mismatches. With intrinsics KK and K′K' known, FF upgrades to E=K′TFKE = K'^T F K, the subject of the next page.

Worked numbers

Pure translation along the xx axis gives FF with rows (0,0,0)(0,0,0), (0,0,−1)(0,0,-1), (0,1,0)(0,1,0). Take x=(2,1,1)x = (2, 1, 1):

l′=Fx=(0, −1, 1)l' = F x = (0,\ -1,\ 1)

so the epipolar line is 0⋅u−1⋅v+1=00 \cdot u - 1 \cdot v + 1 = 0, the horizontal line v=1v = 1. The true match x′=(5,1,1)x' = (5, 1, 1) lies on it, and the constraint confirms:

x′TFx=5×0+1×(−1)+1×1=0x'^T F x = 5 \times 0 + 1 \times (-1) + 1 \times 1 = 0

A wrong match such as (5,2,1)(5, 2, 1) would score −1-1, 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.0

Watch Out For

Estimating F from a flat scene

If every matched point lies on one plane, a homography explains all matches and FF 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 88-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 3×33 \times 3 rank-2 matrix.
  • The epipolar constraint x′TFx=0x'^T F x = 0 tests any candidate match algebraically.
  • FF has 77 degrees of freedom: nine entries minus scale minus the rank constraint.
  • The 88-point algorithm plus SVD rank projection is the standard estimator.
  • With known intrinsics, FF upgrades to the essential matrix via E=K′TFKE = K'^T F K.
  • Flat scenes make FF degenerate; a homography owns that case instead.