Open3d: Non-blocking rendering

Created on 8 Feb 2018  路  2Comments  路  Source: intel-isl/Open3D

Hi,
I am wondering if there is a way to render an image and interact with it while the code keep running.

I am implementing a non-rigid registration pipeline based on many optimization cycles, and I'd like to see how the optimization work in every loop.
Now running "draw_geometries" method, it waits until I close the windows to goes on.

Thanks!
R

enhancement help wanted

Most helpful comment

I could get something parallelized to work by exposing Visualizer::PollEvents (added to src/Python/Visualization/py3d_visualizer.cpp) in the python bindings and using a Process from the multiprocessing module (Thread from threading didn't work) where I call that in a loop.

I am using a Queue to bring new data to visualize from the main thread to the background process, but found that the py3d.PointCloud can't be communcated that way (I read that things are pickled and unpickled behind the scenes in Queue), so I use bare numpy arrays and recreate them.

All 2 comments

That's good question. How about using from threading import Thread? draw_geometries is based on GLFW, and it supports multi-threading. A good reference for Python multi-threading is here. You will need to design worker threads to display new geometry once it is obtained from registration pipeline.

I could get something parallelized to work by exposing Visualizer::PollEvents (added to src/Python/Visualization/py3d_visualizer.cpp) in the python bindings and using a Process from the multiprocessing module (Thread from threading didn't work) where I call that in a loop.

I am using a Queue to bring new data to visualize from the main thread to the background process, but found that the py3d.PointCloud can't be communcated that way (I read that things are pickled and unpickled behind the scenes in Queue), so I use bare numpy arrays and recreate them.

Was this page helpful?
0 / 5 - 0 ratings