8

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

For that I found the Rotation Matrix (3x3) and translation matrix (3x1) of those objects.

How can I find the Rotation Angle and Rotation Axis of object using those matrices?

Jav_Rock
  • 22,059
  • 20
  • 123
  • 164
aranga
  • 377
  • 1
  • 6
  • 20
  • If you just want the axis angle representation of your rotation matrix then you don't need the translation matrix at all. You can find the conversion anywhere on the internet, like section "2.3 Conversion from and to axis-angle" of the [Wikipedia article](http://en.wikipedia.org/wiki/Rotation_matrix#Conversion_from_and_to_axis-angle) on rotation matrices. – Hammer Sep 17 '12 at 17:58

2 Answers2

12

For every type of conversion between rotation representations you have this website euclidean space.

You will find theory and code samples of:

  • Rotation matrix to quaternion: link

  • Quaternion to axis angle: link

  • Rotations in general and all representations: link

And in relation to your question you have Axis Angle. If you have the rotation matrix R (3x3), you can obtain the angle and axis this way (see Matrix to Axis Angle):

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

  • Axis 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);

Jav_Rock
  • 22,059
  • 20
  • 123
  • 164
  • Hi..jav i have a another one question.my object was placed parallel to a wheel.when the wheel is moving,my object also moved using the rotation matrix i was calculated the angle and rotation axis.Now the question is,how to calculate the rotation angle of the wheel center or spindle.http://i47.tinypic.com/344vck6.jpg – aranga Sep 23 '12 at 04:55
1

Already working wih openCV I would rcommend using the Rodrigues method: cv::Rodrigues(src, dst, jacobian), that computes the rotation vector if you have a rotation matrix for an argument and vice versa.

jochen
  • 413
  • 2
  • 10