Skip to content
AI360Xpert

Epipolar Geometry

Epipolar geometry connects two views of the same 3D scene, showing how a point in one image restricts where it can appear in the other.

How epipolar geometry connects two camera views.
How epipolar geometry connects two camera views.

Why Does This Exist?

When two cameras look at the same 3D scene, finding which pixel in one image corresponds to a pixel in the other is a massive search problem. Epipolar geometry restricts this search to a single line instead of a whole 2D image, making depth estimation computationally feasible.

Think of It Like This

Imagine two people looking at a distant mountain peak from different positions. If you draw a line from each person's eye to the peak, these lines and the line connecting the two people form a geometric plane. This relationship instantly limits where one person can tell the other to look.

How It Actually Works

Epipolar geometry relies on a few fundamental concepts:

  1. Epipoles: The point where the baseline (the line connecting the two camera centers) intersects each image plane.
  2. Epipolar Plane: The plane formed by the 3D point and the two camera centers.
  3. Epipolar Lines: The intersection of the epipolar plane with each image plane. If a point is seen at a specific pixel in one camera, it must lie on the corresponding epipolar line in the other camera.
  4. Fundamental Matrix: A 3×33 \times 3 matrix FF that relates corresponding points between two uncalibrated images, such that xTFx=0x'^T F x = 0.

Code

import numpy as np
def epipolar_constraint(x: np.ndarray, x_prime: np.ndarray, F: np.ndarray) -> float:    # x and x_prime are homogeneous coordinates [u, v, 1]    # F is the Fundamental Matrix    return float(x_prime.T @ F @ x)
x = np.array([100, 150, 1])x_prime = np.array([120, 145, 1])F = np.eye(3) * 0.01  # Placeholder matrixprint(epipolar_constraint(x, x_prime, F))# -> 0.01

Watch Out For

Degenerate configurations: If all the 3D points lie on a single plane or the cameras only undergo pure rotation, the standard algorithms to compute the fundamental matrix will become numerically unstable.

The Quick Version

  • It relates two different views of the same 3D scene algebraically.
  • It reduces the 2D correspondence search to a 1D search along epipolar lines.
  • The fundamental matrix encapsulates this geometry for uncalibrated cameras.
  • It forms the core mathematical foundation for stereo vision.