PCL学习——八叉树搜索

创建octree实例

float resolution=128.0f //分辨率
pcl::octree::OctreePointCloudSearch<pcl::PointXYZ>octree(resolution);//初始化octree
octree.setInputCloud(cloud);
octree.addPointsFromInputCloud();


体素近邻搜索:

vector<int>pointIdxVec;    //最近点索引
octree.voxelSearch(searchPoint,PointIdxVec);

K近邻搜索:
octree.nearestKSearch(searchPoint,K,索引向量,距离)

半径内近邻搜索:
octree.radiusSearch(searchPoint,半径,索引向量,距离)

猜你喜欢

转载自blog.csdn.net/zzh_AI/article/details/88846330