📘
Compute Epipolar Line
EasyMultiple Cameras
Given a fundamental matrix F and a point x1=[x,y,1]T in image 1, compute the corresponding epipolar line l2 in image 2.
The epipolar line is computed as:
l2=F⋅x1
where l2=[a,b,c]T represents the line ax+by+c=0 in image 2.
Normalization: The line coefficients should be normalized so that:
a2+b2=1
This ensures the coefficients represent a proper line equation where c 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 by multiplying the fundamental matrix F with the point x1=[10,20,1]T: l2=F⋅x1=0000010−10⋅10201=0−120
- Then, we normalize the line coefficients [0,−1,20]T to satisfy a2+b2=1: since 02+(−1)2=1, the coefficients are already normalized.
- The final output is [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
Python 3.13.1
Test Results
0/0Run code to see test results.