0

What is the unit of output points4D param in OpenCV's triangulatePoints function?

I have been working on Visual Odometry and I'm not getting the expected output. So, to fix some issues, I'm trying to understand the nitty-gritty of the different functions being used. One of the underlying functions is triangulatePoints():

void cv::triangulatePoints(InputArray   projMatr1,
                           InputArray   projMatr2,
                           InputArray   projPoints1,
                           InputArray   projPoints2,
                           OutputArray  points4D 
                          )

As per the documentation (OpenCV 4.2.0):

points4D - 4xN array of reconstructed points in homogeneous coordinates.

So, what are the units of these points in points4D?

As per another documentation (OpenCV 4.5.5):

points4D - 4xN array of reconstructed points in homogeneous coordinates. These points are returned in the world's coordinate system.

This one is a bit more informative. But still, it does not say anything about the units of reconstructed points. Are they in pixels or meters or something else?

Also, as we are not passing any information about the pixel size, the units of reconstructed points cannot be 'meters', correct?

Note 1: I know we are passing projection matrices. However, they have mainly fx, fy, cx, cy, and some other stuff but not the pixel size, right?

Milan
  • 1,743
  • 2
  • 13
  • 36

2 Answers2

0

The projection matrices, being 3x4, contain pose data, i.e. rotation and translation.

The distance between camera origins is an IPD (interpupillary distance). It defines your world coordinate system's scaling (units), or rather, how the image points fit in there.

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
0

To construct your projection matrices you have combined your camera calibration matrix (focal length and centerpoint in both x and y direction) and your camera pose matrix (rotation & translation w.r.t. World Coordinate System).

In my case, I obtained the camera pose matrix using ArUCo markers. For this I give the real world ArUCo marker size as an input. This results in a translation vector in my pose matrix in millimeters.

Hope this helps.

jorritboot
  • 11
  • 1