Skip to content

Commit

Permalink
Handle non-dense clouds in FPFHEstimationOMP
Browse files Browse the repository at this point in the history
Check for NaN/Inf to avoid assertion in kdtree search
  • Loading branch information
ThorstenHarter committed Apr 18, 2018
1 parent 569e05e commit 5ca7c1f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions features/include/pcl/features/impl/fpfh_omp.hpp
Expand Up @@ -62,7 +62,8 @@ pcl::FPFHEstimationOMP<PointInT, PointNT, PointOutT>::computeFeature (PointCloud
for (size_t idx = 0; idx < indices_->size (); ++idx)
{
int p_idx = (*indices_)[idx];
if (this->searchForNeighbors (p_idx, search_parameter_, nn_indices, nn_dists) == 0)
if (!isFinite ((*input_)[p_idx]) ||
this->searchForNeighbors (p_idx, search_parameter_, nn_indices, nn_dists) == 0)
continue;

spfh_indices_set.insert (nn_indices.begin (), nn_indices.end ());
Expand Down Expand Up @@ -98,7 +99,8 @@ pcl::FPFHEstimationOMP<PointInT, PointNT, PointOutT>::computeFeature (PointCloud
int p_idx = spfh_indices_vec[i];

// Find the neighborhood around p_idx
if (this->searchForNeighbors (*surface_, p_idx, search_parameter_, nn_indices, nn_dists) == 0)
if (!isFinite ((*input_)[p_idx]) ||
this->searchForNeighbors (*surface_, p_idx, search_parameter_, nn_indices, nn_dists) == 0)
continue;

// Estimate the SPFH signature around p_idx
Expand Down

0 comments on commit 5ca7c1f

Please sign in to comment.