py123d_detection.geometry

SE(3) helpers shared by the export code.

123D poses and the mmdet3d info schema both use scalar-first quaternions, so the two map onto each other directly. Everything in between is plain 4x4 matrices.

Module Attributes

YAW_CONVENTIONS

Keyed by ExportConfig.yaw_convention.

Functions

heading_yaw(rotation)

Yaw as the heading of the frame's x axis, the convention of the nuScenes devkit's quaternion_yaw.

invert_rigid(matrix)

Invert a 4x4 rigid transform (no scale or shear) without a general matrix inverse.

matrix_to_translation_quaternion(matrix)

Split a 4x4 transform into the ([x, y, z], [qw, qx, qy, qz]) pair used by mmdet3d infos.

mmdet3d_yaw(rotation)

Yaw as pyquaternion.Quaternion.yaw_pitch_roll[0], which mmdetection3d's converter uses.

pose_to_matrix(pose)

rotate_vectors(matrix, vectors)

transform_points(matrix, points)

py123d_detection.geometry.YAW_CONVENTIONS = {'heading': <function heading_yaw>, 'mmdet3d': <function mmdet3d_yaw>}

Keyed by ExportConfig.yaw_convention.