Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimal example O3DVisualizer with KITTI data #7063

Open
3 tasks done
Petros626 opened this issue Nov 19, 2024 · 0 comments
Open
3 tasks done

Minimal example O3DVisualizer with KITTI data #7063

Petros626 opened this issue Nov 19, 2024 · 0 comments
Labels

Comments

@Petros626
Copy link

Checklist

My Question

Hello,

I got the problem to visualize a normal point cloud with gt labels. I got the order of O3DVisualizer initialisation from one of the examples here.

def draw_demo_scenesO3D(points, gt_boxes=None, ref_boxes=None, ref_labels=None, ref_scores=None, point_colors=None, draw_origin=True, vc=None):
    if isinstance(points, torch.Tensor):
        points = points.cpu().numpy()
    if isinstance(gt_boxes, torch.Tensor):
        gt_boxes = gt_boxes.cpu().numpy()
    if isinstance(ref_boxes, torch.Tensor):
        ref_boxes = ref_boxes.cpu().numpy()

    app = open3d.visualization.gui.Application.instance
    app.initialize()
    vis = open3d.visualization.O3DVisualizer('Open3D - O3DVisualizer', 640, 480)
    vis.show_settings = True
   
    vis.point_size = 1
    vis.set_background((0, 0, 0, 1), None) # RGBA

    # draw origin (x = Forward, y = Left ,z = Upward)
    if draw_origin:
        axis_pcd = open3d.geometry.TriangleMesh.create_coordinate_frame(size=1.0, origin=[0, 0, 0])
        vis.add_geometry("Axis", axis_pcd)

    pts = open3d.geometry.PointCloud()
    pts.points = open3d.utility.Vector3dVector(points[:, :3]) # x, y, z
    vis.add_geometry("Points", pts)

    if point_colors is None:
        pts.colors = open3d.utility.Vector3dVector(np.ones((points.shape[0], 3)))
    else:
        pts.colors = open3d.utility.Vector3dVector(point_colors)

    if gt_boxes is not None:
        vis = draw_demo_boxO3D(vis, gt_boxes, keypoint_color=(0, 0, 1)) 

    app.add_window(vis)
    app.run()
    vis.close()

    return vis

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant