java.lang.Object
imagingbook.calibration.zhang.util.Rotations
This class defines methods for converting between Rodrigues rotation vectors and 3D rotation matrices, plus some
related utility methods. None of these methods is currently used in other parts of the calibration library.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isRotationMatrix
(double[][] R) Checks if the specified matrix is a rotation matrix using the default orthogonality threshold (DefaultOrthogonalityThreshold
).static boolean
isRotationMatrix
(double[][] R, double threshold) Checks if the specified matrix is a rotation matrix under the given orthogonality threshold.static double
normalizeAngle
(double angle) Normalized the given angle to [-π,π].static double[]
toRodriguesVector
(double[][] R) Converts a 3D rotation matrix (R) to the equivalent Rodrigues rotation vector.static double[][]
toRotationMatrix
(double[] rv) Converts a given Rodrigues rotation vector to the equivalent 3D rotation matrix.
-
Field Details
-
DefaultOrthogonalityThreshold
- See Also:
-
-
Constructor Details
-
Rotations
public Rotations()
-
-
Method Details
-
toRotationMatrix
Converts a given Rodrigues rotation vector to the equivalent 3D rotation matrix. Hand-made calculation (uses no library methods).- Parameters:
rv
- Rodrigues rotation vector- Returns:
- the 3D rotation matrix
-
toRodriguesVector
Converts a 3D rotation matrix (R) to the equivalent Rodrigues rotation vector. From "Vector Representation of Rotations", Carlo Tomasi (https://www.cs.duke.edu/courses/fall13/compsci527/notes/rodrigues.pdf). Matlab code: http://www.cs.duke.edu/courses/fall13/compsci527/notes/rodrigues.m- Parameters:
R
- a 3D rotation matrix- Returns:
- the Rodrigues rotation vector
-
isRotationMatrix
Checks if the specified matrix is a rotation matrix under the given orthogonality threshold.- Parameters:
R
- the matrix to be checkedthreshold
- the orthogonality threshold- Returns:
-
isRotationMatrix
Checks if the specified matrix is a rotation matrix using the default orthogonality threshold (DefaultOrthogonalityThreshold
).- Parameters:
R
- the matrix to be checked- Returns:
-
normalizeAngle
Normalized the given angle to [-π,π].- Parameters:
angle
- some angle (any finite value)- Returns:
- the equivalent angle in [-π,π]
-