You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nanoflann::KdTreeFLANN<PB::pmPointXYZ>::Ptr kdtree = std::make_shared<nanoflann::KdTreeFLANN<PB::pmPointXYZ>>();
if (!kdtree) {
std::cerr << "KD tree build failed!" << std::endl;
return;
}
kdtree->setInputCloud(cloud);
for (int i = 0; i < checkcorrs.size(); ++i) {
std::vector<int> searchIndexes;
std::vector<SCALAR_TYPE> distances;
SCALAR_TYPE *search_pt = new SCALAR_TYPE[3];
search_pt[0] = checkcorrs[i].x;
search_pt[1] = checkcorrs[i].y;
search_pt[2] = checkcorrs[i].z;
kdtree->radiusSearch(search_pt, 2.0, searchIndexes, distances);
}
The size of searchIndexes is always equal to 1 during the for-loop(I have checked the point that the number of the nearest point is large), and once the searched point's distance is too large(e.g. distance>10m ), the searchIndexes[0] also be same with the i-1 iteration result. What's the point? Is this a bug?
The text was updated successfully, but these errors were encountered:
@jlblancoc , thanks for the reply but I could not provide the minimum size code for now, and I implement the kdtree search operation with CoudCompare octree for the deadline of project in a hurry. I will try to reproduce this bug.
The size of searchIndexes is always equal to 1 during the for-loop(I have checked the point that the number of the nearest point is large), and once the searched point's distance is too large(e.g. distance>10m ), the searchIndexes[0] also be same with the i-1 iteration result. What's the point? Is this a bug?
The text was updated successfully, but these errors were encountered: