Get rotation axis from rotation matrix and translation vector in OpenCV

I have a chessboard in two images with some angle of rotation. Allows you to find the rotation angle of the second image with reference to the first image.

To do this, I found the rotation matrix (3x3) and the translation matrix (3x1) of these objects.

How can I find the angle of rotation and the axis of rotation of an object using these matrices?

+5
source share
2 answers

For each type of conversion between rotation views , you have this website Euclidean space .

You will find examples of theory and code:

  • :

  • :

  • :

Axis Angle. R (3x3), (. ):

  • angle = acos(( R00 + R11 + R22 - 1)/2);

  • x, y, x:

    x = (R21-R12)/sqrt ((R21-R12) ^ 2 + (R02-R20) ^ 2 + (R10-R01) ^ 2);

    y = (R02 - R20)/sqrt ((R21 - R12) 2 + (R02 - R20) 2 + (R10 - R01) ^ 2);

    z = (R10 - R01)/sqrt ((R21 - R12) 2 + (R02 - R20) 2 + (R10 - R01) ^ 2);

+9
0

All Articles