Search code examples
open3d

Open3D drawing frames with bounding boxes


I have a question about showing files of pointcloud as frames and having bounding boxes drawn per frame, the problem is that it is so slow

vis = o3d.visualization.visualizer()
pcd = o3d.io.read_point_cloud(pcd_path1)
vis.add_geometry(pcd)

for pcdPath in pcdPaths:
  pcd = o3d.io.read_point_cloud(pcd_path)

  # After Clustering then converting labels into list of boxes

  for box in boxes:
    vis.add_geometry(box, reset_bounding_box=False)

  vis.update_geometry(pcd)
  vis.poll_events()
  vis.update_renderer()

  for box in boxes:
    box.clear()

What I observed that add_geometry() is the line slowing the code from around 0.02sec to 0.5sec per frame.

Seems to be that the method of Non-blocking visualization "visualizer()" is not recommended based on what I have read online but what is the other option if I want to have a run of frames with bounding boxes. Any suggestions?


Solution

  • I found a new solution where I avoided using open3d visualization tools but instead a pyqtgraph widget which requires nothing but the ndarray source