pytransform3d.rotations.matrix_from_rotation_6d#

pytransform3d.rotations.matrix_from_rotation_6d(rotation_6d)[source]#

Compute rotation matrix from 6D rotation representation.

Recovers a rotation matrix from the continuous 6D representation of Zhou et al. [1] (see rotation_6d_from_matrix()). The representation stores two 3D vectors \(\boldsymbol{a}_1, \boldsymbol{a}_2\) that are in general neither of unit length nor orthogonal, for instance because they are the raw output of a neural network. The columns \(\boldsymbol{b}_1, \boldsymbol{b}_2, \boldsymbol{b}_3\) of the rotation matrix are reconstructed by Gram-Schmidt orthonormalization

\[\begin{split}\begin{aligned} \boldsymbol{b}_1 &= N(\boldsymbol{a}_1)\\ \boldsymbol{b}_2 &= N(\boldsymbol{a}_2 - (\boldsymbol{b}_1 \cdot \boldsymbol{a}_2) \boldsymbol{b}_1)\\ \boldsymbol{b}_3 &= \boldsymbol{b}_1 \times \boldsymbol{b}_2 \end{aligned}\end{split}\]

where \(N(\cdot)\) normalizes a vector to unit length. This maps any pair of non-parallel, nonzero vectors to \(SO(3)\).

Parameters:
rotation_6darray-like, shape (6,)

6D rotation representation: two stacked 3D vectors \((\boldsymbol{a}_1, \boldsymbol{a}_2)\) from which the first two columns of the rotation matrix are computed.

Returns:
Rarray, shape (3, 3)

Rotation matrix.

Raises:
ValueError

If the two encoded vectors are zero or parallel, in which case no valid rotation matrix can be recovered.

See also

rotation_6d_from_matrix

Compute 6D rotation representation from rotation matrix.

matrix_from_two_vectors

Compute rotation matrix from two vectors, used to orthonormalize the 6D 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