sksurgerycalibration.algorithms.triangulate module

Functions for Triangulation using Harley method

sksurgerycalibration.algorithms.triangulate.l2r_to_p2d(p2d, l2r)[source]

Function to convert l2r array to p2d array, which removes last row of l2r to create p2d. Notes. l2r_to_p2d() is used in triangulate_points_hartley() to avoid too many variables in one method (see R0914).

Parameters:
  • p2d – [3x4] narray
  • l2r – [4x4] narray
Return p2d:

[3x4] narray

sksurgerycalibration.algorithms.triangulate.new_e2_array(e2_array, r2_array, left_to_right_trans_vector)[source]

Function to create a new_e2_array which concatenate left_to_right_trans_vector into the last column of e2_array. Notes. new_e2_array() is used in triangulate_points_hartley() to avoid too many variables in one method (see R0914)

Parameters:
  • e2_array – [4x4] narray
  • r2_array – = left_to_right_rotation_matrix: [3x3] narray
  • left_to_right_trans_vector – [3x1] narray
Return e2_array:
 

[4x4] narray

sksurgerycalibration.algorithms.triangulate.triangulate_points_hartley(input_undistorted_points, left_camera_intrinsic_params, right_camera_intrinsic_params, left_to_right_rotation_matrix, left_to_right_trans_vector)[source]

Function to compute triangulation of points using Harley

Parameters:
  • input_undistorted_points – [4x4] narray
  • left_camera_intrinsic_params – [3x3] narray
  • right_camera_intrinsic_params – [3x3] narray
  • left_to_right_rotation_matrix – [3x3] narray
  • left_to_right_trans_vector – [3x1] narray
Return outputPoints:
 

[4x3] narray

  • Hartley, Richard I., and Peter Sturm. “Triangulation.” Computer vision and image understanding 68, no. 2 (1997): 146-157.
  • Prince, Simon JD. Computer vision: models, learning, and inference. Cambridge University Press, 2012.
Return outputPoints:
 
sksurgerycalibration.algorithms.triangulate.triangulate_points_opencv(input_undistorted_points, left_camera_intrinsic_params, right_camera_intrinsic_params, left_to_right_rotation_matrix, left_to_right_trans_vector)[source]

Function to compute triangulation of points using Harley with cv2.triangulatePoints

Parameters:
  • input_undistorted_points – [4x4] narray
  • left_camera_intrinsic_params – [3x3] narray
  • right_camera_intrinsic_params – [3x3] narray
  • left_to_right_rotation_matrix – [3x3] narray
  • left_to_right_trans_vector – [3x1] narray
Return output_points:
 

[4x3] narray

Other related variables:
left_undistorted, right_undistorted: point image positions in 2 cameras left_undistorted[4x2], right_undistorted[4x2] from input_undistorted_points [4x4]

Hartley, Richard I., and Peter Sturm. “Triangulation.” Computer vision and image understanding 68, no. 2 (1997): 146-157.