OpenCV  4.5.3 Open Source Computer Vision
cv::QuatEnum Class Reference

#include <opencv2/core/quaternion.hpp>

## Public Types

enum  EulerAnglesType {
INT_XYZ,
INT_XZY,
INT_YXZ,
INT_YZX,
INT_ZXY,
INT_ZYX,
INT_XYX,
INT_XZX,
INT_YXY,
INT_YZY,
INT_ZXZ,
INT_ZYZ,
EXT_XYZ,
EXT_XZY,
EXT_YXZ,
EXT_YZX,
EXT_ZXY,
EXT_ZYX,
EXT_XYX,
EXT_XZX,
EXT_YXY,
EXT_YZY,
EXT_ZXZ,
EXT_ZYZ
}
Enum of Euler angles type. More...

## ◆ EulerAnglesType

Enum of Euler angles type.

Without considering the possibility of using two different convertions for the definition of the rotation axes , there exists twelve possible sequences of rotation axes, divided into two groups:

• Proper Euler angles (Z-X-Z, X-Y-X, Y-Z-Y, Z-Y-Z, X-Z-X, Y-X-Y)
• Tait–Bryan angles (X-Y-Z, Y-Z-X, Z-X-Y, X-Z-Y, Z-Y-X, Y-X-Z).

The three elemental rotations may be extrinsic (rotations about the axes xyz of the original coordinate system, which is assumed to remain motionless), or intrinsic(rotations about the axes of the rotating coordinate system XYZ, solidary with the moving body, which changes its orientation after each elemental rotation).

Extrinsic and intrinsic rotations are relevant.

The definition of the Euler angles is as following,

• $$\theta_1$$ represents the first rotation angle,
• $$\theta_2$$ represents the second rotation angle,
• $$\theta_3$$ represents the third rotation angle.

For intrinsic rotations in the order of X-Y-Z, the rotation matrix R can be calculated by:

$R =X(\theta_1) Y(\theta_2) Z(\theta_3)$

For extrinsic rotations in the order of X-Y-Z, the rotation matrix R can be calculated by:

$R =Z({\theta_3}) Y({\theta_2}) X({\theta_1})$

where

$X({\theta})={\begin{bmatrix}1&0&0\\0&\cos {\theta_1} &-\sin {\theta_1} \\0&\sin {\theta_1} &\cos {\theta_1} \\\end{bmatrix}}, Y({\theta})={\begin{bmatrix}\cos \theta_{2}&0&\sin \theta_{2}\\0&1 &0 \\\ -sin \theta_2& 0&\cos \theta_{2} \\\end{bmatrix}}, Z({\theta})={\begin{bmatrix}\cos\theta_{3} &-\sin \theta_3&0\\\sin \theta_3 &\cos \theta_3 &0\\0&0&1\\\end{bmatrix}}.$

The function is designed according to this set of conventions:

• Right handed reference frames are adopted, and the right hand rule is used to determine the sign of angles.
• Each matrix is meant to represent an active rotation (the composing and composed matrices are supposed to act on the coordinates of vectors defined in the initial fixed reference frame and give as a result the coordinates of a rotated vector defined in the same reference frame).
• For $$\theta_1$$ and $$\theta_3$$, the valid range is (−π, π].

For $$\theta_2$$, the valid range is [−π/2, π/2] or [0, π].

For Tait–Bryan angles, the valid range of $$\theta_2$$ is [−π/2, π/2]. When transforming a quaternion to Euler angles, the solution of Euler angles is unique in condition of $$\theta_2 \in (−π/2, π/2)$$ . If $$\theta_2 = −π/2$$ or $$\theta_2 = π/2$$, there are infinite solutions. The common name for this situation is gimbal lock. For Proper Euler angles,the valid range of $$\theta_2$$ is in [0, π]. The solutions of Euler angles are unique in condition of $$\theta_2 \in (0, π)$$ . If $$\theta_2 =0$$ or $$\theta_2 =π$$, there are infinite solutions and gimbal lock will occur.

Enumerator
INT_XYZ

Intrinsic rotations with the Euler angles type X-Y-Z.

INT_XZY

Intrinsic rotations with the Euler angles type X-Z-Y.

INT_YXZ

Intrinsic rotations with the Euler angles type Y-X-Z.

INT_YZX

Intrinsic rotations with the Euler angles type Y-Z-X.

INT_ZXY

Intrinsic rotations with the Euler angles type Z-X-Y.

INT_ZYX

Intrinsic rotations with the Euler angles type Z-Y-X.

INT_XYX

Intrinsic rotations with the Euler angles type X-Y-X.

INT_XZX

Intrinsic rotations with the Euler angles type X-Z-X.

INT_YXY

Intrinsic rotations with the Euler angles type Y-X-Y.

INT_YZY

Intrinsic rotations with the Euler angles type Y-Z-Y.

INT_ZXZ

Intrinsic rotations with the Euler angles type Z-X-Z.

INT_ZYZ

Intrinsic rotations with the Euler angles type Z-Y-Z.

EXT_XYZ

Extrinsic rotations with the Euler angles type X-Y-Z.

EXT_XZY

Extrinsic rotations with the Euler angles type X-Z-Y.

EXT_YXZ

Extrinsic rotations with the Euler angles type Y-X-Z.

EXT_YZX

Extrinsic rotations with the Euler angles type Y-Z-X.

EXT_ZXY

Extrinsic rotations with the Euler angles type Z-X-Y.

EXT_ZYX

Extrinsic rotations with the Euler angles type Z-Y-X.

EXT_XYX

Extrinsic rotations with the Euler angles type X-Y-X.

EXT_XZX

Extrinsic rotations with the Euler angles type X-Z-X.

EXT_YXY

Extrinsic rotations with the Euler angles type Y-X-Y.

EXT_YZY

Extrinsic rotations with the Euler angles type Y-Z-Y.

EXT_ZXZ

Extrinsic rotations with the Euler angles type Z-X-Z.

EXT_ZYZ

Extrinsic rotations with the Euler angles type Z-Y-Z.

The documentation for this class was generated from the following file: