v9.1.1
Menu

Compute Epipolar Line

easyFREEMultiple CamerasComputer Vision 1

Given a fundamental matrix FF and a point x1=[x,y,1]T\mathbf{x}_1 = [x, y, 1]^T in image 1, compute the corresponding epipolar line l2\mathbf{l}_2 in image 2.

The epipolar line is computed as:

l2=F⋅x1\mathbf{l}_2 = F \cdot \mathbf{x}_1

where l2=[a,b,c]T\mathbf{l}_2 = [a, b, c]^T represents the line ax+by+c=0ax + by + c = 0 in image 2.

Normalization: The line coefficients should be normalized so that:

a2+b2=1\sqrt{a^2 + b^2} = 1

This ensures the coefficients represent a proper line equation where cc gives the signed distance from the origin to the line.

Epipolar lines are fundamental in stereo vision -- they constrain where a corresponding point can appear in the second image, reducing the search from 2D to 1D.

Round each coefficient to 4 decimal places.

Example

Input
F = [[0, 0, 0],
     [0, 0, -1],
     [0, 1, 0]]
x1 = [10, 20, 1]
Output
[0.0, -1.0, 20.0]
Reasoning
  • F is the 3×33 \times 3 fundamental matrix linking the two views; x1 =[10,20,1]T= [10, 20, 1]^T is pixel (10,20)(10, 20) of image 1 in homogeneous form.
  • Each line coefficient is one row of FF dotted with x1\mathbf{x}_1: row 1 gives 00; row 2 gives (−1)⋅1=−1(-1) \cdot 1 = -1; row 3 gives 1⋅20=201 \cdot 20 = 20. So l2=[0,−1,20]T\mathbf{l}_2 = [0, -1, 20]^T.
  • Normalization factor: 02+(−1)2=1\sqrt{0^2 + (-1)^2} = 1, so dividing aa, bb, cc by it changes nothing here. A raw line [0,−2,40][0, -2, 40] would shrink to the same [0,−1,20][0, -1, 20].
  • The output [0.0, -1.0, 20.0] is the line −y+20=0-y + 20 = 0, i.e. the horizontal row y=20y = 20, at distance ∣c∣=20|c| = 20 from the origin.
  • Notice it is the same row the point sits on in image 1: this FF describes a rectified side-by-side stereo pair, where matches lie on the same scanline.

Constraints

  • F: 3x3 fundamental matrix as list of lists
  • x1: Point in image 1 as [x, y, 1] (homogeneous coordinates)
  • Return: Normalized line coefficients [a, b, c] as a list
  • Normalize so that sqrt(a^2 + b^2) = 1
  • Round to 4 decimal places

Learn this in

More from Computer Vision 1

solution.py

Test results

Sign in to run your code against the test cases.