puzzlepaint / surfelmeshing

Real-time surfel-based mesh reconstruction from RGB-D video.
BSD 3-Clause "New" or "Revised" License
420 stars 83 forks source link

Render library problem #6

Closed CanCanZeng closed 5 years ago

CanCanZeng commented 5 years ago

Hi @puzzlepaint , is it possible to remove the render window from surfelmeshing algorithm? I'd like to use opencv and pangolin for rendering instead of QT, but it seems that the render window is tightly coupled with CUDA in the algorithm, is there any simple way to change the render library? Or do you plan to implement render window with other library?

puzzlepaint commented 5 years ago

Hi, I am not planning to integrate any other rendering library myself.

Removing the render window should be easy, since it should not be required for the algorithm, just for visualization.

Replacing the rendering with a different window/library should also be doable, since the integration with the CUDA part should be limited to only the vertex buffer of the mesh. See the functions InitializeForCUDAInterop() and InitializeForCUDAInteropInRenderingThread() in surfel_meshing_render_window.cc. Basically, the vertex buffer must be registered with CUDA such that CUDA can do updates to the vertices ( see here ). And a windowless rendering context must be initialized which shares names with the rendering context of the window ( see here ). I am not familiar with pangolin, so I can't say how much effort that would be.

CanCanZeng commented 5 years ago

Thank you for your help. I already removed all of the GL related part, now the code cannot show any image, but easier for reading and porting. Another problem is that I cannot read images in JPG format, I guess removing QT caused this problem since I can still read PNG format images. So I wonder why you did not use opencv to manage image IO and storage, since most people who study computer vision or image processing will use opencv. Never mind, I‘m just curious.

puzzlepaint commented 5 years ago

OpenCV does provide useful functionality, but not always in a good way in my opinion. With my own similar library 'libvis' I attempted to solve some of the same tasks in a better way (but as the ReadMe states, it is a work in progress and not recommended for use in other projects). Clearly, if you remove Qt then the functionality will be limited. Qt also supports a wide variety of platforms and is available under LGPL, so usually I don't think that there should be a need to remove it.

CanCanZeng commented 5 years ago

Thank you for your reply. I see, QT is also very useful and widely used. Maybe it's my prejudice, and too lazy to learn it, that I'll think about getting rid of it.