CropHull::applyFilter3D speedup using AABB tree #5300
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request provides a tested AABB tree implementation using CGAL (Computational Geometry Algorithms Library).
This implementation is used to speed up
CropHull::applyFilter3D
which shoots rays into a scene and checks for intersections with the triangle mesh. On top of that, the function is also parallelized by setting the number of threads usingCropHull::setNumberOfThreads
.A quick benchmark showing the difference in performance is provided below.
CPU: Intel Core i5 6300HQ
RAM: 16GB DDR4-2133 (dual channel)
Laptop: Dell XPS 15 9550
Mesh: David (Michelangelo) mesh (https://commons.wikimedia.org/wiki/File:David_(Michelangelo).stl)
Input cloud size: 10,000 points (randomly generated)
Number of threads: 4 (only applicable for new implementation)
The mesh is simplified using CGAL's surface mesh simplification.
The numbers for the AABB tree implementation include tree construction time which is automatically performed the first time
applyFilter3D
is called (if tree construction is not called explicitly first).For simpler geometry, the speedup is lower but should still be respectable.
I have added a new module (
aabb_tree
) to the documentation. Please let me know if there are any improvements I could add there.I would also appreciate feedback regarding the modifications to the CMake scripts that were required to make this work.
Thank you very much!