如何从矩阵计算角度 [英] How to calculate the angle from Roational matrix

查看:249
本文介绍了如何从矩阵计算角度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用单个对象的两个图像对象与其第一个图像有一定程度的匹配。

我计算了每个图像的POSE,并使用Rodergues()将旋转向量转换为Matrix, 。现在我如何计算并看到它从第一个位置旋转多少?
$ $ $ $
i尝试了很多方法,但答案是没有关闭_
编辑:我的相机是固定的对象正在移动

解决方案

我们可以使用以下公式从旋转矩阵中获取欧拉角。



给定一个3×3旋转矩阵





3个欧拉角度









这里atan2是相同的反正切函数,有象限检查,通常在C或Matlab中找到。 / p>

注意:如果围绕y轴的角度正好是+/- 90°,则必须小心。在这种情况下,第一列和最后一行中除了下角的一个(1或-1)之外的所有元素将为0(cos(1)= 0)。一种解决方案是将围绕x轴的旋转固定为180°,并从以下位置计算围绕z轴的角度:atan2(r_12,-r_22)。



另请参见 http://www.soi.city.ac.uk /~sbbh653/publications/euler.pdf


I am using two image of the single object the object is roated certain degree from its first image.
And 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

解决方案

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

Given a 3×3 rotation matrix

The 3 Euler angles are

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 http://www.soi.city.ac.uk/~sbbh653/publications/euler.pdf

这篇关于如何从矩阵计算角度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆