Skip to content

Retrieve Picked Points - WebRTC #7218

Open
@ddkats

Description

@ddkats

Checklist

My Question

Is there a way to implement the functionality of picking points on a point cloud and retrieving the array of selected points using WebRTC? Or is there another workaround?

def pick_points(pcd):
    """Allows the user to pick points interactively in the Open3D viewer."""
    
    o3d.visualization.webrtc_server.enable_webrtc()
    
    print("Please pick points to define a region. Press 'Q' to finish.")
    
    vis = o3d.visualization.VisualizerWithEditing()
    vis.create_window()
    vis.add_geometry(pcd)
    vis.run()
    picked_indices = vis.get_picked_points()
    vis.destroy_window()
    
    return np.asarray(pcd.points)[picked_indices]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions