Skip to content
DeepForgeby svx
All problems
MediumComputer Visioncv-370

Fundamental Matrix Constraint

Problem

Evaluate the fundamental matrix constraint for a correspondence.

For homogeneous points x1 and x2 (given as 2D pixels), compute x2^T F x1 and return its absolute value rounded to 4 decimal places. A correspondence that satisfies the epipolar geometry gives exactly 0.

Hint

Append a 1 to both points before applying F.

Test cases

case 1
in: [[[1,0,0],[0,1,0],[0,0,1]],[1,2],[3,4]]
expected: 12
case 2
in: [[[0,0,0],[0,0,-1],[0,1,0]],[0,0],[0,0]]
expected: 0
case 3
in: [[[1,0,0],[0,1,0],[0,0,1]],[-1,-1],[2,2]]
expected: 3
case 4
in: [[[0,0,0],[0,0,-1],[0,1,0]],[2,1],[1,2]]
expected: 1
Starter codePython
def fundamental_residual(F, x1, x2):
    # Your code here
    pass

4 test cases · run your code against them in the editor