Inspired by the logic in organized.h: always keep point_candidates sorted, inserting new entries at the correct places. This avoids repeated calls to std::sort and having more than k entries in point_candidates.
Benchmarks:
NormalEstimation (without OpenMP) with octree:
NormalEstimation
Old
New
k=50, cloud=milk
2607 ms
1842 ms
k=50, cloud=mug
2043 ms
1505 ms
k=100, cloud=milk
5650 ms
3075 ms
k=100, cloud=mug
3824 ms
2436 ms
Calling nearestKSearch on every (valid) point of a cloud:
Inspired by the logic in organized.h: always keep
point_candidates
sorted, inserting new entries at the correct places. This avoids repeated calls to std::sort and having more thank
entries inpoint_candidates
.