Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Fast GP3 and Organized Surface Reconstruction via CLI #1309

Open
nirmalsnair opened this issue Jul 8, 2024 · 5 comments
Open

Using Fast GP3 and Organized Surface Reconstruction via CLI #1309

nirmalsnair opened this issue Jul 8, 2024 · 5 comments

Comments

@nirmalsnair
Copy link

nirmalsnair commented Jul 8, 2024

Hi @matlabbe,
Is it possible to use the Fast GP3 or Organized surface reconstruction methods instead of Poisson via command line?
In my tests, I found Poisson (55s) to be much slower compared to Fast GP3 (20s) and Organized (15s).

@matlabbe
Copy link
Member

You would have to change the code here:

rtabmap/tools/Export/main.cpp

Lines 1798 to 1805 in 08a44ec

// Mesh reconstruction
printf("Mesh reconstruction... depth=%d\n", optimizedDepth);
pcl::PolygonMesh::Ptr mesh(new pcl::PolygonMesh);
pcl::Poisson<pcl::PointXYZRGBNormal> poisson;
poisson.setDepth(optimizedDepth);
poisson.setInputCloud(cloudToExport);
poisson.reconstruct(*mesh);
printf("Mesh reconstruction... done (%fs, %d polygons).\n", timer.ticks(), (int)mesh->polygons.size());

and change it for gp3 following that tutorial for example: https://pcl.readthedocs.io/projects/tutorials/en/latest/greedy_projection.html#greedy-triangulation

For Organized, that would be more difficult to do, but not sure this is an useful reconstruction though. Organized creates meshes independently for each image, it doesn't create mesh on the merged cloud like Poisson and GP3.

To increase speed of Poisson, you can lower the resolution with --poisson_depth (set to 8 or 9)

@nirmalsnair
Copy link
Author

Thanks @matlabbe, will try to modify the code to make Fast GP3 available via CLI.

@nirmalsnair
Copy link
Author

Organized creates meshes independently for each image, it doesn't create mesh on the merged cloud like Poisson and GP3.

On my test data, Organized is generating a single mesh just like the other two methods.

(Generated via GUI using the default export parameter values with 'Meshing' and 'Texture mapping' enabled)

Poisson
Screenshot 2024-07-23 153304

Fast GP3
Screenshot 2024-07-23 153809

Organized
Screenshot 2024-07-23 153816

@matlabbe
Copy link
Member

Organized generates one file, but some polygons taken from different cameras may overlap. For example, when two cameras overlap, you would see two surfaces overlapping when zooming in. With Poisson, only one surface would be generated (like an average of the two surfaces).

@nirmalsnair
Copy link
Author

Understood, thanks for the clarification.

On a different note, I've noticed that during the mesh export, the GPU usage remains almost zero, even when using the RTAB-Map CUDA version (RTABMap-0.21.4-win64-cuda117.exe). Is this typical? Is there a way to utilize the GPU to speed up the mesh export?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants