Is there any way to save output of draw_geometries as jpg or png format in python?
This tutorial should be helpful: customized visualization then go to "Capture images in a customized animation"
The example shows the "vis.capture_screen_float_buffer(False)" Method to take a screenshot, which could be saved using the "plt.imsave()" Method.
I have an additional question.
Is there a way to close my visualizer/figure? I want to make a movie of my pointcloud at different epochs using python.
Thanks in advance
I have an additional question.
Is there a way to close my visualizer/figure? I want to make a movie of my pointcloud at different epochs using python.Thanks in advance
Thanks @Nerolf05 .I also stuck in that point. I am able to store the image once I close the visualizer output. I have to deploy my code on server,where I may not able to close the visualizer output manually. I get to know how to hide window by (vis.create_window(visible = False)), but after loading pcd to it, if we run "vis.run()" command terminal gets hang.
@Nerolf05 Currently I am able to store depth image, but the same logic fails for storing RGB image, it gives current screenshot as a image.
I use following code for depth :
vis = o3d.visualization.Visualizer() ;
vis.create_window(visible = False) ;
vis.add_geometry(pcd) ;
depth = vis.capture_depth_float_buffer(True) ;
plt.imshow(np.asarray(depth))
For RGB image :
vis = o3d.visualization.Visualizer() ;
vis.create_window(visible = False) ;
vis.add_geometry(pcd) ;
img = vis.capture_screen_float_buffer(True);
plt.imshow(np.asarray(img))
I use " ; " for new line, as code is print in wrong format. Sorry for that.
@rupeshchandgude i use vis.capture_screen_image(path, do_render) to capture the screen.
I also tried to close the Visualizer with a second Process, but i wasnt able to do it successfully.
@Nerolf05 Maybe we should try to find the way to close that window programmatically, so the code will go further to save output.
@Nerolf05 Following function can be used to store image without visualizer output .
vis = o3d.visualization.Visualizer()
vis.create_window()
vis.add_geometry(pcd)
vis.update_geometry()
vis.poll_events()
vis.update_renderer()
vis.capture_screen_image(path)
vis.destroy_window()
Hello, sorry, but i have to repoen this issue, because the proposed method by @Nerolf05 raises following exception:
vis.update_geometry()
TypeError: update_geometry(): incompatible function arguments. The following argument types are supported:
1. (self: open3d.open3d.visualization.Visualizer, arg0: open3d.open3d.geometry.Geometry) -> bool
@ArashJavan The following should work on v0.10.0:
vis = o3d.visualization.Visualizer()
vis.create_window()
vis.add_geometry(pcd)
vis.update_geometry(pcd)
vis.poll_events()
vis.update_renderer()
vis.capture_screen_image(path)
vis.destroy_window()
Most helpful comment
@Nerolf05 Following function can be used to store image without visualizer output .