pytransform3d.rotations.rotation_6d_from_matrix#

pytransform3d.rotations.rotation_6d_from_matrix(R, strict_check=True)[source]#

Compute 6D rotation representation from rotation matrix.

The 6D representation of Zhou et al. [1] is a continuous representation of rotations that is well suited as regression target of neural networks, unlike quaternions, axis-angle, or Euler angles, whose mappings from \(SO(3)\) are discontinuous. It is obtained by dropping the last column of the rotation matrix

\[\begin{split}\boldsymbol{R} = \left( \begin{array}{ccc} r_{11} & r_{12} & r_{13}\\ r_{21} & r_{22} & r_{23}\\ r_{31} & r_{32} & r_{33} \end{array} \right) \in SO(3)\end{split}\]

and stacking its first two columns

\[\left( r_{11}, r_{21}, r_{31}, r_{12}, r_{22}, r_{32} \right)^T.\]

The dropped column is redundant: it can be recovered from the other two through the cross product (see matrix_from_rotation_6d()), which is why it does not have to be stored.

Parameters:
Rarray-like, shape (3, 3)

Rotation matrix.

strict_checkbool, optional (default: True)

Raise a ValueError if the rotation matrix is not numerically close enough to a real rotation matrix. Otherwise we print a warning.

Returns:
rotation_6darray, shape (6,)

6D rotation representation: the first two columns of the rotation matrix, stacked one after the other.

See also

matrix_from_rotation_6d

Compute rotation matrix from 6D rotation representation.

References

[1]

Zhou, Y., Barnes, C., Lu, J., Yang, J., Li, H. (2019). On the Continuity of Rotation Representations in Neural Networks. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 5745-5753. https://arxiv.org/abs/1812.07035