Open3d - 将多个点云可视化为视频/动画

Rya*_*yan 8 python video save-as point-clouds open3d

我已经使用 RGB+深度视频生成了多个点云,并且希望将多个点云可视化为视频或动画。

\n

目前我使用的是Python,我的部分代码如下:

\n
for i in range(1,10)\n       pcd = Track.create_pcd(i)\n       o3d.visualization.draw_geometries([pcd])\n       pcd_list.append(pcd)\n
Run Code Online (Sandbox Code Playgroud)\n

当我使用draw_geometries或draw_geometries_with_animation_callback时,它们似乎无法显示点云列表:

\n
o3d.visualization.draw_geometries([pcd_list])\n
Run Code Online (Sandbox Code Playgroud)\n

或者

\n
def rotate_view(vis):\n    ctr = vis.get_view_control()\n    ctr.rotate(10.0, 0.0)\n    return False\n    \no3d.visualization.draw_geometries_with_animation_callback([pcd_list],rotate_view)\n
Run Code Online (Sandbox Code Playgroud)\n

它给出了以下错误:

\n
\n

类型错误:draw_geometries():函数参数不兼容。支持\n以下参数类型:

\n
    \n
  1. (geometry_list:列表[open3d.open3d_pybind.geometry.Geometry],window_name:str = \xe2\x80\x98Open3D\xe2\x80\x99,宽度:int = 1920,高度:int = 1080,\n左:int = 50,顶部:int = 50,point_show_normal:bool = False,\ nmesh_show_wireframe:bool = False,mesh_show_back_face:bool = False)\ n->无
  2. \n
\n
\n

是否有任何示例说明如何将点云列表导出到视频中,例如设置查看器,并使用 0.5 秒的等待键显示每个点云,然后另存为视频文件(.mp4/.avi)?\n和还要获取然后设置视频中点云的固定视点?

\n

非常感谢!

\n

Jin*_*hao 5

您可以使用 Open3D非阻塞可视化

会是这样的

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()
Run Code Online (Sandbox Code Playgroud)

  • 当我使用这段代码时,窗口对我来说仍然是空的? (9认同)
  • 好吧,事实证明,如果几何体在调用 add_geometry(geometry) 时已经定义了点,那么它就可以工作。因此,我添加了一个小标志,如果这是第一次迭代,则调用 add_geometry,否则调用 update_geometry。现在它起作用了。诡异的 (3认同)
  • @TheSeamau5,这对我来说没有解决,为什么仍然是空的。 (3认同)