Skip to content

Faster octree nearestKSearch#6037

Merged
mvieth merged 1 commit intoPointCloudLibrary:masterfrom
mvieth:faster_octree_knnsearch
May 13, 2024
Merged

Faster octree nearestKSearch#6037
mvieth merged 1 commit intoPointCloudLibrary:masterfrom
mvieth:faster_octree_knnsearch

Conversation

@mvieth
Copy link
Copy Markdown
Member

@mvieth mvieth commented May 12, 2024

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:

Search Old New
k=1, cloud1 818 ms 509 ms
k=1, cloud2 791 ms 613 ms
k=1, cloud3 773 ms 744 ms
k=5, cloud1 914 ms 637 ms
k=5, cloud2 950 ms 780 ms
k=5, cloud3 1083 ms 1033 ms

@mvieth mvieth added changelog: enhancement Meta-information for changelog generation module: octree labels May 12, 2024
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 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:
| Search       | Old       | New        |
|--------------|-----------|------------|
| k=1, cloud1  | 818 ms    | 509 ms     |
| k=1, cloud2  | 791 ms    | 613 ms     |
| k=1, cloud3  | 773 ms    | 744 ms     |
| k=5, cloud1  | 914 ms    | 637 ms     |
| k=5, cloud2  | 950 ms    | 780 ms     |
| k=5, cloud3  | 1083 ms   | 1033 ms    |
@mvieth mvieth force-pushed the faster_octree_knnsearch branch from 4426fd8 to bf0965b Compare May 12, 2024 15:22
@larshg
Copy link
Copy Markdown
Contributor

larshg commented May 13, 2024

Nice improvements!

@mvieth mvieth merged commit 5373884 into PointCloudLibrary:master May 13, 2024
@mvieth mvieth deleted the faster_octree_knnsearch branch May 13, 2024 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: enhancement Meta-information for changelog generation module: octree

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants