Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open3d - visualizing multiple point clouds as a video/animation

I have generated multiple point clouds using a RGB+depth video, and would like to visualize the multiple point clouds as a video or animation.

Currently I am using Python, part of my code is as follows:

for i in range(1,10)
       pcd = Track.create_pcd(i)
       o3d.visualization.draw_geometries([pcd])
       pcd_list.append(pcd)

When I use draw_geometries or draw_geometries_with_animation_callback, it seems they could not display a list of point clouds:

o3d.visualization.draw_geometries([pcd_list])

or

def rotate_view(vis):
    ctr = vis.get_view_control()
    ctr.rotate(10.0, 0.0)
    return False
    
o3d.visualization.draw_geometries_with_animation_callback([pcd_list],rotate_view)

It gave the following error:

TypeError: draw_geometries(): incompatible function arguments. The following argument types are supported:

  1. (geometry_list: List[open3d.open3d_pybind.geometry.Geometry], window_name: str = ‘Open3D’, width: int = 1920, height: int = 1080, left: int = 50, top: int = 50, point_show_normal: bool = False, mesh_show_wireframe: bool = False, mesh_show_back_face: bool = False) -> None

Is there any example of how to export list of point cloud into a video, like setting a viewer, and displaying each point cloud with a waitkey of 0.5 seconds, and then save as a video file (.mp4/.avi)? And also to get and then set a fixed viewpoint of the point clouds in the video?

Thank you very much!

like image 726
Ryan Avatar asked Jun 28 '26 13:06

Ryan


1 Answers

You can use Open3D Non-blocking visualization.

It'll be like this

vis = o3d.visualization.Visualizer()
vis.create_window()

# geometry is the point cloud used in your animaiton
geometry = o3d.geometry.PointCloud()
vis.add_geometry(geometry)

for i in range(icp_iteration):
    # now modify the points of your geometry
    # you can use whatever method suits you best, this is just an example
    geometry.points = pcd_list[i].points
    vis.update_geometry(geometry)
    vis.poll_events()
    vis.update_renderer()
like image 122
Jing Zhao Avatar answered Jun 30 '26 02:06

Jing Zhao



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!