Dealing with transformation is tricky.
You have to be sure that you are comparing the same things.
If you are sure that the quaternion <==> angle-axis conversion is correct, you have to be able to draw the coordinates system of all the elements:
- ArUco coordinates system, can you tell me how the z-axis is pointing (I know already the answer)?
- camera coordinates system, as it is classical used in computer vision
- the above two allow you to interpret the
translation + rotation
returned by OpenCV - Unity object coordinates system, are you sure that the ArUco coordinates system (the texture image) and the coordinates system for the Unity object match?
- Unity coordinates system, for instance with OpenGL the camera coordinates system is probably left-handed?
An easy way to interpret the coordinates system is to look at the translation part. For instance, with the translation returned by OpenCV, you can easily interpret and validate t_z
.
Once you have validated these points:
- be sure to test with the ArUco marker appearing the bigger in the image
- because there can be an ambiguity for planar pose estimation in certain conditions, see the ArUco doc
- but this should occur rarely and not when the tag is big in the image (at least less likely)
Good luck.