def triangulate_point(x1, x2, P1, P2):
 M = zeros((6, 6))
 M[:3, :4] = P1
 M[3:, :4] = P2
 M[:3, 4] = (- x1)
 M[3:, 5] = (- x2)
 (U, S, V) = linalg.svd(M)
 X = V[(-1), :4]
 return (X / X[3])

def triangulate_point ( x1 , x2 , P1 , P2 ) : M = zeros ( ( 6 , 6 ) ) M [ : 3 , : 4 ] = P1 M [ 3 : , : 4 ] = P2 M [ : 3 , 4 ] = ( - x1 ) M [ 3 : , 5 ] = ( - x2 ) ( U , S , V ) = linalg . svd ( M ) X = V [ ( - 1 ) , : 4 ] return ( X / X [ 3 ] )
point pair triangulation from least squares solution .