Recover 3-D points from their images in two calibrated views with the linear (DLT) triangulation method, and measure how well they explain the observations.
Given two camera matrices and with rows and , and an observed pixel pair in the first view and in the second:
Implement:
triangulate_point(P1, P2, x1, x2): one point, returns a length-3 array.triangulate(P1, P2, pts1, pts2): (N, 2) arrays of matches, returns (N, 3).reprojection_errors(P, X, pts): the Euclidean pixel distance between each observed point and the projection of the corresponding 3-D point, an (N,) array.