vision3d.transforms.functional#
Functional form of the 3D transforms in vision3d.transforms.
Functions
|
Flip a tensor along a 3D spatial axis. |
|
Flip 3D bounding boxes along |
|
Flip point cloud coordinates along |
|
Dispatcher entry point for point jittering. |
|
Add noise to point xyz coordinates. |
|
Register a kernel for a functional and TVTensor type. |
|
Rotate a tensor by a 3x3 rotation matrix. |
|
Rotate 3D bounding boxes by |
|
Update camera extrinsics after rotating the lidar frame. |
|
Rotate point cloud coordinates by |
|
Dispatcher entry point for point sampling. |
|
Select points by index. |
|
Scale a tensor by a uniform factor. |
|
Scale 3D bounding boxes by |
|
Update camera extrinsics after scaling the lidar frame. |
|
Scale point cloud coordinates by |
|
Dispatcher entry point for point shuffling. |
|
Permute point order. |
|
Translate a tensor by a 3D offset. |
|
Translate 3D bounding boxes by |
|
Update camera extrinsics after translating the lidar frame. |
|
Translate point cloud coordinates by |
- vision3d.transforms.functional.flip_3d(inpt, *, axis)[source]#
Flip a tensor along a 3D spatial axis.
This is the dispatcher entry point. Type-specific kernels are registered below.
- vision3d.transforms.functional.flip_3d_bounding_boxes(boxes, *, format, axis)[source]#
Flip 3D bounding boxes along
axis.- Parameters:
boxes (Tensor) – Bounding box tensor
[..., K].format (BoundingBox3DFormat) – Format of the boxes.
axis (str) – One of
"x","y","z".
- Returns:
Flipped bounding boxes with the same shape.
- Return type:
- vision3d.transforms.functional.flip_3d_point_cloud(points, *, axis)[source]#
Flip point cloud coordinates along
axis.
- vision3d.transforms.functional.jitter_points(inpt, *, noise)[source]#
Dispatcher entry point for point jittering.
- vision3d.transforms.functional.jitter_points_point_cloud(points, *, noise)[source]#
Add noise to point xyz coordinates.
- vision3d.transforms.functional.register_kernel(functional, tv_tensor_cls, *, tv_tensor_wrapper=True)[source]#
Register a kernel for a functional and TVTensor type.
- Parameters:
functional (Callable[[...], Any]) – The functional to register a kernel for.
tv_tensor_cls (type[TVTensor]) – The TVTensor subclass this kernel handles.
tv_tensor_wrapper (bool) – If True (default), the kernel receives an unwrapped pure tensor and the output is automatically re-wrapped. If False, the kernel receives the full TVTensor and must handle wrap itself.
- Returns:
Decorator that registers the kernel.
- Return type:
- vision3d.transforms.functional.rotate_3d(inpt, *, rotation_matrix)[source]#
Rotate a tensor by a 3x3 rotation matrix.
Dispatcher entry point. Type-specific kernels are registered below.
- vision3d.transforms.functional.rotate_3d_bounding_boxes(boxes, *, format, rotation_matrix)[source]#
Rotate 3D bounding boxes by
rotation_matrix.Only rotated formats are supported:
XYZLWHY: only Z-axis rotations (pure yaw).XYZLWHYPR: arbitrary rotations.
Axis-aligned formats (
XYZXYZ,XYZLWH) cannot represent rotation and will raiseNotImplementedError.- Parameters:
boxes (Tensor) – Bounding box tensor
[..., K].format (BoundingBox3DFormat) – Format of the boxes.
rotation_matrix (Tensor) –
[3, 3]rotation matrix.
- Returns:
Rotated bounding boxes with the same shape.
- Raises:
NotImplementedError – If
formatis axis-aligned.ValueError – If
formatisXYZLWHYand rotation is not pure yaw.
- Return type:
- vision3d.transforms.functional.rotate_3d_camera_extrinsics(extrinsics, *, rotation_matrix)[source]#
Update camera extrinsics after rotating the lidar frame.
The lidar-to-camera extrinsic
Esatisfiesp_cam = E @ p_lidar. After rotating the lidar frame byR, points becomep' = R @ p, soE' = E @ R_invto keepp_cam = E' @ p'.
- vision3d.transforms.functional.rotate_3d_point_cloud(points, *, rotation_matrix)[source]#
Rotate point cloud coordinates by
rotation_matrix.
- vision3d.transforms.functional.sample_points(inpt, *, indices)[source]#
Dispatcher entry point for point sampling.
- vision3d.transforms.functional.sample_points_point_cloud(points, *, indices)[source]#
Select points by index.
- vision3d.transforms.functional.scale_3d(inpt, *, factor)[source]#
Scale a tensor by a uniform factor.
Dispatcher entry point. Type-specific kernels are registered below.
- vision3d.transforms.functional.scale_3d_bounding_boxes(boxes, *, format, factor)[source]#
Scale 3D bounding boxes by
factor.Scales both position and dimensions. Rotation angles are unchanged.
- Parameters:
boxes (Tensor) – Bounding box tensor
[..., K].format (BoundingBox3DFormat) – Format of the boxes.
factor (float) – Scale factor.
- Returns:
Scaled bounding boxes with the same shape.
- Return type:
- vision3d.transforms.functional.scale_3d_camera_extrinsics(extrinsics, *, factor)[source]#
Update camera extrinsics after scaling the lidar frame.
- vision3d.transforms.functional.scale_3d_point_cloud(points, *, factor)[source]#
Scale point cloud coordinates by
factor.
- vision3d.transforms.functional.shuffle_points(inpt, *, perm)[source]#
Dispatcher entry point for point shuffling.
- vision3d.transforms.functional.shuffle_points_point_cloud(points, *, perm)[source]#
Permute point order.
- vision3d.transforms.functional.translate_3d(inpt, *, offset)[source]#
Translate a tensor by a 3D offset.
Dispatcher entry point. Type-specific kernels are registered below.
- vision3d.transforms.functional.translate_3d_bounding_boxes(boxes, *, format, offset)[source]#
Translate 3D bounding boxes by
offset.- Parameters:
boxes (Tensor) – Bounding box tensor
[..., K].format (BoundingBox3DFormat) – Format of the boxes.
offset (Tensor) – Translation
[3]as(tx, ty, tz).
- Returns:
Translated bounding boxes with the same shape.
- Return type:
- vision3d.transforms.functional.translate_3d_camera_extrinsics(extrinsics, *, offset)[source]#
Update camera extrinsics after translating the lidar frame.
The lidar-to-camera extrinsic translation changes because the lidar origin moved by
offsetin the lidar frame.