Octree
K-D Tree may be good for high-dimensional space; however, for 3D point clouds, Octree may provide better performance in some cases. In the following, we report some benchmark results on LiDAR point clouds.
Experiment 1: Ouster LiDAR cloud
Target cloud size = 65536, source cloud size = 3000.
For each point in the source cloud, find its neighbor point in the target cloud.
The scale is roughly 10-50 meters, in a structured environment.
13-gen Intel evo i7 CPU (dell xps laptop), single threading.
Both data structures are implemented in PCL.
Operation | K-D Tree | Octree (leaf size 0.01 m) | Octree (leaf size 0.001m) |
---|---|---|---|
Build Tree | 7 ms | 8 ms | 12 ms |
Approximate NN Search (k=1) | (not support) | 94 ms | 96 ms |
K-NN Search (k=1) | 124 ms | 390 ms | 408 ms |
K-NN Search (k=10) | 124 ms | 395 ms | 452 ms |
K-NN Search (k=100) | 134 ms | 573 ms | 698 ms |
Radius Search (r=0.01 m) | 1789 ms | 126 ms | 126 ms |
Radius Search (r=0.1 m) | 1799 ms | 129 ms | 130 ms |
Radius Search (r=1 m) | 2011 ms | 415 ms | 861 ms |
Other observations from ablation study:
Time consumption of tree building is linear in target cloud size.
Time consumption of each search method is also almost linear in source/query cloud size. (i.e. size = 30000 can roughly take 10x more time than size = 3000).
The location and shape of source query cloud does not affect much on running time.
PCL Point Type (PointXYZ vs. PointXYZRGBNormal) does not affect much on running time.
Other notes:
This result can be accelerated by multi-threading, e.g., OpenMP.
The
approxNearestSearch
method in Octree can only find the nearest point (k=1 case), and uses tree nodes as the approximate result similar to the radius search to speed up.
Experiment 2: Velodyne LiDAR Cloud (VLP-16)
Target cloud size = 28209 (NaN points removed), source cloud size = 3000.
For each point in the source cloud, find its neighbor point in the target cloud.
The scale is roughly 10-50 meters, in a structured environment.
13-gen Intel evo i7 CPU (dell xps laptop), single threading.
Both data structures are implemented in PCL.
Operation | K-D Tree | Octree (leaf size 0.01 m) | Octree (leaf size 0.001m) |
---|---|---|---|
Build Tree | 4 ms | 6 ms | 9 ms |
Approximate NN Search (k=1) | (not support) | 1.5 ms | 1.5 ms |
K-NN Search (k=1) | 3 ms | 23 ms | 23 ms |
K-NN Search (k=10) | 5 ms | 41 ms | 57 ms |
K-NN Search (k=100) | 21 ms | 407 ms | 539 ms |
Radius Search (r=0.01 m) | 1 ms | 2 ms | 2 ms |
Radius Search (r=0.1 m) | 2 ms | 4 ms | 5 ms |
Radius Search (r=1 m) | 34 ms | 59 ms | 138 ms |
Notes (based on new observations):
If using method K-NN Search (k=1), Octree and K-D Tree can get almost the same neighbor points as the output result.
If using method Approximate NN Search (k=1) from Octree, the result will be approximated and most likely different from the K-NN Search (k=1) result. This method is OK to be used in finding the neighbor points (to constitute a submap) from a global map, but it should not be used internally in an ICP algorithm in each iteration, as it can make the algorithm not to converge.
Benchmark Code
Last updated