Skip to content
DeepForgeby svx
All problems
MediumComputer Visioncv-369

Reprojection Error

Problem

Compute the reprojection error of a 3D point.

Project [X, Y, Z] through the 3x3 intrinsic matrix K using homogeneous division. Return the Euclidean distance to the observed pixel [u, v] rounded to 4 decimal places.

Hint

This is the pixel-space residual minimized by bundle adjustment.

Test cases

case 1
in: [[1,2,4],[[1,0,0],[0,1,0],[0,0,1]],[0.25,0.5]]
expected: 0
case 2
in: [[1,2,4],[[100,0,50],[0,100,40],[0,0,1]],[75,90]]
expected: 0
case 3
in: [[0,0,2],[[100,0,50],[0,100,40],[0,0,1]],[55,40]]
expected: 5
case 4
in: [[1,1,2],[[100,0,0],[0,100,0],[0,0,1]],[51,50]]
expected: 1
Starter codePython
def reprojection_error(point, K, observed):
    # Your code here
    pass

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