rotationMatrixToVector

Convert 3-D rotation matrix to rotation vector

Syntax

rotationVector = rotationMatrixToVector(rotationMatrix)

Description

example

rotationVector = rotationMatrixToVector(rotationMatrix) returns an axis-angle rotation vector that corresponds to the input 3-D rotation matrix. The function uses the Rodrigues formula for the conversion.

Examples

collapse all

Create a matrix representing a 90-degree rotation about the Z -axis.

rotationMatrix = [0, -1, 0; 1, 0, 0; 0, 0, 1];

Find the equivalent rotation vector.

rotationVector = rotationMatrixToVector(rotationMatrix)
rotationVector = 1×3

         0         0   -1.5708

Input Arguments

collapse all

Rotation of camera, specified as a 3-by-3 matrix. You can obtain this matrix by using the extrinsics function.

Output Arguments

collapse all

Rotation vector, returned as a three-element vector. The vector represents the axis of rotation in 3-D, where the magnitude corresponds to the rotation angle in radians.

Data Types: single | double

References

[1] Trucco, E., and A. Verri. Introductory Techniques for 3-D Computer Vision." Prentice Hall, 1998.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2016a