Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate the angle from rotation matrix

I am using two image of the single object the object is roated certain degree from its first image.

I have calculated the POSE of each image and converted the rotational vector to Matrix using Rodergues(). Now how do I calculate and see how much it is rotated from its first position?

I have tried many ways but answers was no were close

EDIT: My camera is fixed only the object is moving.

like image 637
N.J Avatar asked Feb 22 '13 11:02

N.J


People also ask

What is the angle of a rotation?

In mathematics, the angle of rotation is a measurement of the amount, of namely angle, that a figure is rotated about a fixed point, often the center of a circle.

What is rotation matrix formula?

Rotation Matrix Example Now, |P| = (cos2θ + sin2θ) = 1. Thus, P is a rotation matrix. We can say that P rotates the cartesian coordinates in an anticlockwise direction through θ with respect to the x-axis in a 2-D system.


1 Answers

We can get Euler angles from rotation matrix using following formula.

Given a 3×3 rotation matrix

enter image description here

The 3 Euler angles are

enter image description here

enter image description here

enter image description here

Here atan2 is the same arc tangent function, with quadrant checking, you typically find in C or Matlab.

Note: Care must be taken if the angle around the y-axis is exactly +/-90°. In that case all elements in the first column and last row, except the one in the lower corner, which is either 1 or -1, will be 0 (cos(1)=0). One solution would be to fix the rotation around the x-axis at 180° and compute the angle around the z-axis from: atan2(r_12, -r_22).

See also https://www.geometrictools.com/Documentation/EulerAngles.pdf, which includes implementations for six different orders of Euler angles.

like image 132
Krish Avatar answered Sep 18 '22 22:09

Krish