Skip to content Skip to sidebar Skip to footer

How To Get The Camera Rotation? (aruco Library)

I've been trying to understand the output of the aruco_test.cpp program that is included when you download the Aruco Library. The output has this format: 22=(236.87,86.4296) (422.5

Solution 1:

How can I know the axis of my camera? I mean, is there a way to know where the x, y and z are facing?

This is defined in the OpenCV library. x-axis increases from left to right of the image, y-axis increases from top to bottom of the image, and z axis increases towards the front of the camera. Below image explains this axis selection. pinhole_camera_model

How can I get the rotation of the camera from the rotation of the object wrt the camera?

rvec is the rotation of the marker with respect to the camera frame. You can convert rvec to a 3x3 rotation matrix using the built-in Rodrigues function. If the marker is aligned with camera frame, this rotation matrix should read 3x3 identity matrix.

If you get the inverse of this matrix (this is a rotation matrix, so the inverse is the transpose of the matrix), that is the rotation of the camera with respect to the marker.

Can someone explain me the meaning of the vectors better so I can really understand it? I think my main problem here is that I don't really know what those numbers mean for real.

tvec is the distance from the origin of the camera frame to the center of the detected marker (this is F_c - P line on the figure. rvec is as described in the above answer.

Post a Comment for "How To Get The Camera Rotation? (aruco Library)"