Ask Your Question

Obtaining Euler angles from Rodrigues Rotation Matrix

asked 2018-04-16 10:54:16 -0600

malharjajoo gravatar image

updated 2018-04-16 10:54:46 -0600


I wish to extract Euler angles from the rvec output parameter of cv::solvePnp.

I understand that 3x1 rvec needs to be passed on to the Rodrigues function to obtain the 3x3 rotation matrix.

But to obtain Euler Angles, I need to use a fixed convention ( see this , for example Z-Y-X,etc ) which requires the rotation matrix to be obtained from a permutation (fixed order) of multiplication of Matrices ,

eg: for Z-Y-X convention, R_resultant = Rz * Ry * Rx.

I have looked into the source code here for Rodrigues function but don't quite understand how the matrix is formed Hence -

My Question: What is the convention (Z-Y-X, X-Y-Z, etc) of the formation of the 3x3 Rotation matrix obtained from Rodrigues ? Without this information I cannot obtain Euler angles. I have seen this tutorial for real time pose estimation, but unfortunately I don't understand the assumption for the convention (and hence I had made another question for that - here).

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-04-16 20:06:22 -0600

Tetragramm gravatar image

Good news! A rotation matrix is a rotation matrix is a rotation matrix. A rotation can be represented by several different conventions of euler angles, ex, the Z-X-Y, ect. However, if they represent the same rotation, the produce the same rotation matrix. It is different matrices multiplied together in a different order, but the same end result.

What that means for you, is that you can decompose the rotation matrix to your heart's content without worrying about how the Rodrigues function works.

edit flag offensive delete link more


Thanks for answering! you mean R_resultant = RxRyRz = RzRyRx = all other x,y,z permutations etc ?

malharjajoo gravatar imagemalharjajoo ( 2018-04-17 08:30:08 -0600 )edit

Absolutely not. I mean R_resultant = Rx1Ry1Rz1 = Rz2Ry2Rx2 = ... Rx1 will not equal Rx2 and so forth.

You simply choose which set of euler angles to decompose it into, and then do so. Your question is wrong. The convention (Z-Y-X, X-Y-Z) is not in the formation of the rotation matrix, it is in the formation of the euler angles. The Rotation matrix is complete, with no convention, or assumptions, or extra information needed.

You can decompose the same rotation matrix into Z-Y-X euler angles, and X-Y-Z euler angles and every other type. The resulting angles will be different, but they are the same rotation.

Tetragramm gravatar imageTetragramm ( 2018-04-18 17:25:15 -0600 )edit

Question Tools

1 follower


Asked: 2018-04-16 10:54:16 -0600

Seen: 4,609 times

Last updated: Apr 16 '18