py123d_detection.core.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
Keyed by ExportConfig.yaw_convention. |
Functions
|
Yaw as the heading of the frame's x axis, the convention of the nuScenes devkit's |
|
Invert a 4x4 rigid transform (no scale or shear) without a general matrix inverse. |
|
Split a 4x4 transform into the |
|
Yaw as |
|
|
|
|
|
- py123d_detection.core.geometry.invert_rigid(matrix)[source]¶
Invert a 4x4 rigid transform (no scale or shear) without a general matrix inverse.
- Return type:
- py123d_detection.core.geometry.matrix_to_translation_quaternion(matrix)[source]¶
Split a 4x4 transform into the
([x, y, z], [qw, qx, qy, qz])pair used by mmdet3d infos.
- py123d_detection.core.geometry.heading_yaw(rotation)[source]¶
Yaw as the heading of the frame’s x axis, the convention of the nuScenes devkit’s
quaternion_yaw.- Return type:
- py123d_detection.core.geometry.mmdet3d_yaw(rotation)[source]¶
Yaw as
pyquaternion.Quaternion.yaw_pitch_roll[0], which mmdetection3d’s converter uses.pyquaternion computes
atan2(2(wz - xy), 1 - 2(y^2 + z^2))where the textbook z-y-x yaw has+xy. Both agree for an upright box and drift apart with roll/pitch: a few milliradians in a lidar frame, but a large angle in a camera frame where the box lies on its side. Matching it keepsgt_boxesinterchangeable with pickles from mmdetection3d’s own converter.- Return type:
- py123d_detection.core.geometry.YAW_CONVENTIONS = {'heading': <function heading_yaw>, 'mmdet3d': <function mmdet3d_yaw>}¶
Keyed by ExportConfig.yaw_convention.