Repository navigation
Replies: 1 comment
|
Interactive use: Shift + left-drag draws a rectangle and adds all points inside it to the selection. Shift + click toggles one point, Ctrl+R clears the selection, and X/Y/Z switch to an orthographic view along an axis. Read the result after the window closes: import open3d as o3d
pcd = o3d.io.read_point_cloud("cloud.ply")
vis = o3d.visualization.VisualizerWithVertexSelection()
vis.create_window()
vis.add_geometry(pcd)
vis.register_selection_changed_callback(
lambda: print(len(vis.get_picked_points()), "points selected"))
vis.run() # Shift + left-drag to select, then close the window
picked = vis.get_picked_points() # list of PickedPoint(index, coord)
vis.destroy_window()
idx = [p.index for p in picked]
selected = pcd.select_by_index(idx)
rest = pcd.select_by_index(idx, invert=True)You can also call it from code with a rectangle in window pixels: indices = vis.pick_points(x, y, w, h) # returns point indices, does not change the selection
vis.add_picked_points(indices) # optional: add them to the selection shown on screenNotes:
I ran this with open3d 0.20.0: |
Uh oh!
There was an error while loading. Please reload this page.
Using Python API, I would like to use the rectangle Picking feature to select a set of points in my displayed pointcloud. Through, I can't see any API to do that. Do I miss something ? Or should I turn myself on O3DVisualizer (which is by default a bit complex for my use-case) or pure-C++ ?
Thanks in advance.
All reactions