Estimate pose of ArUco markers detected in a stereo-setup

asked 2016-10-10 09:28:05 -0600

benT gravatar image

Hi, I have detected ArUco Markers on both images of a stereo-camera setup, and calculated their 3d coordinates with triangulatePoints. How can I calculate their pose in 3d? The ArUco library has some functions to calculate the pose of the markers, but obviousely they are slightly different for the two images. How can I calculate the pose relative to the coordinate system that I get in triangulatePoints?

edit retag flag offensive close merge delete

Comments

If you have calibrated your stereo rig, you should have the transformation between the left / right cameras.

With ArUco, you should get two poses:

  • one for the left camera
  • the other one for the right camera

You can then test if you transform the pose for the left camera to the right using the calibration data you have more or less the same with the right pose from ArUco.

Eduardo gravatar imageEduardo ( 2016-10-10 11:09:39 -0600 )edit

Yes, i have the calibration data, but how can I actually apply them to the points? Is there a function for that?

benT gravatar imagebenT ( 2016-10-10 11:59:14 -0600 )edit

You have to look at homogeneous transformation matrix, for example:

I don't know if there is a function in OpenCV but you can easily do it by matrix multiplication.

Eduardo gravatar imageEduardo ( 2016-10-10 12:59:33 -0600 )edit

so if I understood the linked answers right, all i would have to do is multiply the pose-vector calculated form the left image by P1, and the one from the right by P2 and they should match?

benT gravatar imagebenT ( 2016-10-11 04:06:14 -0600 )edit

With ArUco, you should have:

  • c1Mo (pose of the marker for the camera1)

  • c2Mo (pose of the marker for the camera2)

  • c2Mc1 or c1Mc2 (transformation between the two cameras)

You can check if your transformation between the two cameras is ok or not with:

  • c2Mo should be equal to c2Mc1*c1Mo
Eduardo gravatar imageEduardo ( 2016-10-11 05:06:20 -0600 )edit

thanks, but this is not what I wanted then. What I wanted is to calculate the pose in respect to the same coordinate system of the points calculated with triangulatePoints. Where is the origin of that coordinate system and how can I transform the poses to be in respect to it?

benT gravatar imagebenT ( 2016-10-11 05:25:09 -0600 )edit

It should the left camera? but you can test to check that.

Eduardo gravatar imageEduardo ( 2016-10-11 08:11:26 -0600 )edit

how would I do that? you can find some tests here

benT gravatar imagebenT ( 2016-10-13 11:49:45 -0600 )edit