三维点云学习(2)中-Kd-tree (k-dimensional tree)
kd-tree 实现
代码来自黎老师github
三维kd-tree 的图示
如下图所示,为三维kd-tree的切割图,进行三个维度的切割,kd-tree的本质就是对三个维度的数据点不断构建平衡二叉树。

运行结果
axis 1, split value: leaf, point_indices: [24, 43, 48, 39]
axis 1, split value: leaf, point_indices: [10, 22, 37, 14]
axis 1, split value: leaf, point_indices: [17, 41, 4, 51]
axis 1, split value: leaf, point_indices: [55, 44, 27, 12]
axis 1, split value: leaf, point_indices: [5, 61, 9, 47]
axis 1, split value: leaf, point_indices: [42, 54, 56, 7]
axis 1, split value: leaf, point_indices: [58, 26, 19, 31]
axis 1, split value: leaf, point_indices: [0, 29, 25, 23]
axis 1, split value: leaf, point_indices: [62, 18, 33, 49]
axis 1, split value: leaf, point_indices: [63, 38, 53, 30]
axis 1, split value: leaf, point_indices: [15, 32, 57, 46]
axis 1, split value: leaf, point_indices: [13, 2, 20, 28]
axis 1, split value: leaf, point_indices: [1, 16, 45, 6]
axis 1, split value: leaf, point_indices: [34, 8, 35, 40]
axis 1, split value: leaf, point_indices: [36, 50, 21, 11]
axis 1, split value: leaf, point_indices: [52, 60, 59, 3]
tree max depth: 5

本文深入探讨了三维点云数据处理中KD树的构建与应用,详细讲解了KD树的递归构建过程及KNN搜索算法,通过代码示例展示了如何在三维空间中高效地进行点云数据检索。
最低0.47元/天 解锁文章
1452





