Skip to content

Commit

Permalink
Merge pull request #1827 from lakehanne/master
Browse files Browse the repository at this point in the history
Fixes segfault in our-cvfh when h_index is > 12.
  • Loading branch information
jspricke authored May 30, 2017
2 parents 44ca257 + 75467dd commit 4e77eed
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions features/include/pcl/features/impl/our_cvfh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,13 @@ pcl::OURCVFHEstimation<PointInT, PointNT, PointOutT>::computeRFAndShapeDistribut
}

int h_index = (d <= 0) ? 0 : std::ceil (size_hists * (d / distance_normalization_factor)) - 1;
/* from http://www.pcl-users.org/OUR-CVFH-problem-td4028436.html
h_index will be 13 when d is computed on the farthest away point.
adding the following after computing h_index fixes the problem:
*/
if(h_index > 12)
h_index = 12;
for (int j = 0; j < num_hists; j++)
quadrants[j][h_index] += hist_incr * weights[j];

Expand Down

0 comments on commit 4e77eed

Please sign in to comment.