Estimate pose of ArUco markers detected in a stereo-setup
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?
If you have calibrated your stereo rig, you should have the transformation between the left / right cameras.
With ArUco, you should get two poses:
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.
Yes, i have the calibration data, but how can I actually apply them to the points? Is there a function for that?
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.
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?
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:
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?
It should the left camera? but you can test to check that.
how would I do that? you can find some tests here