rotation_matrix#
- rapidtools.processing.street_localization.rotation_matrix(rotation_vector: Sequence[float] | ndarray) ndarray[source]#
Rotation matrix of an axis-angle vector (Rodrigues’ formula).
Mapillary’s
computed_rotationis such a vector in OpenSfM’s convention: it rotates world coordinates (east, north, up) into camera coordinates (x right, y down, z forward), soR.Tmaps camera rays back into the world.Example
>>> import numpy as np >>> R = rotation_matrix([0.0, 0.0, 0.0]) >>> bool(np.allclose(R, np.eye(3))) True >>> R = rotation_matrix([0.0, 0.0, np.pi / 2]) # quarter turn about z >>> [round(float(v), 6) for v in R @ np.array([1.0, 0.0, 0.0])] [0.0, 1.0, 0.0]