Create a camera coordinate frame (as a mesh) in the world coordinate.
(
H_c2w: T.Union[torch.Tensor, np.ndarray],
frame_size: float = 1.0,
)
| 2549 | |
| 2550 | |
| 2551 | def get_o3d_camera_frame( |
| 2552 | H_c2w: T.Union[torch.Tensor, np.ndarray], |
| 2553 | frame_size: float = 1.0, |
| 2554 | ) -> o3d.geometry.TriangleMesh: |
| 2555 | """Create a camera coordinate frame (as a mesh) in the world coordinate.""" |
| 2556 | |
| 2557 | if isinstance(H_c2w, torch.Tensor): |
| 2558 | H_c2w = H_c2w.detach().cpu().numpy() |
| 2559 | cam_frame = o3d.geometry.TriangleMesh.create_coordinate_frame(size=frame_size) |
| 2560 | cam_frame.transform(H_c2w) |
| 2561 | |
| 2562 | return cam_frame |
| 2563 | |
| 2564 | |
| 2565 | def draw_geometries( |