PIXELBANKv8.2.1
Menu

Compute Epipolar Line

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=Fx1\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:
  • First, we compute the epipolar line l2\mathbf{l}_2 by multiplying the fundamental matrix FF with the point x1=[10,20,1]T\mathbf{x}_1 = [10, 20, 1]^T: l2=Fx1=[000001010][10201]=[0120]\mathbf{l}_2 = F \cdot \mathbf{x}_1 = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & -1 \\ 0 & 1 & 0 \end{bmatrix} \cdot \begin{bmatrix} 10 \\ 20 \\ 1 \end{bmatrix} = \begin{bmatrix} 0 \\ -1 \\ 20 \end{bmatrix}
  • Then, we normalize the line coefficients [0,1,20]T[0, -1, 20]^T to satisfy a2+b2=1\sqrt{a^2 + b^2} = 1: since 02+(1)2=1\sqrt{0^2 + (-1)^2} = 1, the coefficients are already normalized.
  • The final output is [0.0,1.0,20.0][0.0, -1.0, 20.0] after rounding each coefficient to 4 decimal places.

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
Editor

Test Results

0/0
Run code to see test results.