if (surface_ != input_ ||
indices_->size () != surface_->size ())
{
for (const auto& p_idx: *indices_)
{
if (this->searchForNeighbors (p_idx, search_parameter_, nn_indices, nn_dists) == 0)
continue;
spfh_indices.insert (nn_indices.begin (), nn_indices.end ());
}
}`
This piece of code is from the computeSPFHSignatures
function in the feature.hpp
file, and the comment indicates that it computes SPFH for all points in the input point cloud.
For example, after downsampling the point cloud where surface_ != input_
holds true, this->searchForNeighbors(p_idx, search_parameter_, nn_indices, nn_dists)
performs nearest neighbor search on the downsampled point cloud. Despite this, after the loop, spfh_indices
still stores indices from input_
. What is its significance then?We can simply assign the indices stored in indices_
to spfh_indices.
I am puzzled about the purpose of this code snippet.
1