nicetoolbox.utils.triangulation

Helper functions for triangulation of 3D points from stereo images.

Functions

triangulate_stereo

Triangulates the 3D position of points in Euclidean coordinates from two camera views.

undistort_points_pinhole

Undistorts the given points based on intrinsics and distortions parameters.

nicetoolbox.utils.triangulation.triangulate_stereo(projection_matrix1, projection_matrix2, undistorted_points1, undistorted_points2)[source]

Triangulates the 3D position of points in Euclidean coordinates from two camera views.

Parameters:
  • projection_matrix1 (np.array) – Projection matrix of the first camera.

  • projection_matrix2 (np.array) – Projection matrix of the second camera.

  • undistorted_points1 (np.array) – Coordinates of undistorted points from camera 1.

  • undistorted_points2 (np.array) – Coordinates of undistorted points from camera 2.

Returns:

The 3D position of points in Euclidean coordinates.

Return type:

np.array

nicetoolbox.utils.triangulation.undistort_points_pinhole(point_coords, intrinsics, distortions)[source]

Undistorts the given points based on intrinsics and distortions parameters.

Parameters:
  • point_coords (np.array) – The x and y values of the points.

  • intrinsics (np.array) – The intrinsics matrix.

  • distortions (np.array) – The distortions.

Returns:

The undistorted 2D point coordinates.

Return type:

np.array