Pointcloud to image in open3d

I want to create image out of point cloud (.ply), using open3d. I have no problem with reading and visualizing it but can't find anything on saving it as png or jpg. My code, visualizing cloud:

cloud = open3d.read_point_cloud(path)
open3d.draw_geometries([cloud])

Upvotes: 5

Views: 11518

Answers (1)

Alberto MQ
Alberto MQ

Reputation: 468

Try this

    vis = o3d.visualization.Visualizer()
    vis.create_window(visible=False) #works for me with False, on some systems needs to be true
    vis.add_geometry(your_mesh)
    vis.update_geometry(your_mesh)
    vis.poll_events()
    vis.update_renderer()
    vis.capture_screen_image(your_png_path)
    vis.destroy_window()

Upvotes: 15

Related Questions