Skip to content

Commit

Permalink
Addressing reviews. Post 3dsc.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
kunaltyagi committed Nov 4, 2019
1 parent 55b995b commit bde7913
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions features/include/pcl/features/cvfh.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ namespace pcl
inline void
getCentroidClusters (std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > & centroids)
{
for (const auto& centroid: centroids_dominant_orientations_)
centroids.push_back (centroid);
centroids.insert (centroids.cend (), centroids_dominant_orientations_.cbegin (),
centroids_dominant_orientations_.cend ());
}

/** \brief Get the normal centroids used to compute different CVFH descriptors
Expand Down
5 changes: 3 additions & 2 deletions features/include/pcl/features/impl/board.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,9 @@ pcl::BOARDLocalReferenceFrameEstimation<PointInT, PointNT, PointOutT>::computePo
{
return 0;
}
const auto result = std::find(array.begin (), array.end (), 0);
return std::distance(array.begin (), result);
const auto result = std::find_if(array.cbegin (), array.cend (),
[](const auto& x) -> bool { return x;});
return std::distance(array.cbegin (), result);
};
const auto first_no_border = find_first_no_border_pie(check_margin_array_);

Expand Down
4 changes: 1 addition & 3 deletions features/include/pcl/features/impl/brisk_2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ pcl::BRISK2DEstimation<PointInT, PointOutT, KeypointT, IntensityT>::generateKern
// get the total number of points
const auto rings = radius_list.size ();
assert (radius_list.size () != 0 && radius_list.size () == number_list.size ());
points_ = 0; // remember the total number of points
for (const auto number: number_list)
points_ += number;
points_ = std::accumulate (number_list.cbegin (), number_list.cend (), 0);

// set up the patterns
pattern_points_ = new BriskPatternPoint[points_*scales_*n_rot_];
Expand Down
15 changes: 8 additions & 7 deletions features/include/pcl/features/impl/fpfh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,14 @@ pcl::FPFHEstimation<PointInT, PointNT, PointOutT>::weightPointSPFHSignature (
sum_f3 = 100.0 / sum_f3; // histogram values sum up to 100

// Adjust final FPFH values
auto last = std::transform(fpfh_histogram.data (),
fpfh_histogram.data () + nr_bins_f1, fpfh_histogram.data (),
[&sum_f1](const auto& data) { return data * static_cast<float> (sum_f1); });
last = std::transform(last, last + nr_bins_f2, last,
[&sum_f2](const auto& data) { return data * static_cast<float> (sum_f2); });
std::transform(last, last + nr_bins_f3, last,
[&sum_f3](const auto& data) { return data * static_cast<float> (sum_f3); });
const auto denormalize_with = [](const auto& factor)
{
return [&factor](const auto& data) { return data * static_cast<float> (factor); };
};
auto last = std::transform(fpfh_histogram.data (), fpfh_histogram.data () + nr_bins_f1,
fpfh_histogram.data (), denormalize_with (sum_f1));
last = std::transform(last, last + nr_bins_f2, last, denormalize_with (sum_f2));
std::transform(last, last + nr_bins_f3, last, denormalize_with (sum_f3));
}

//////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion features/include/pcl/features/impl/rops_estimation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ pcl::ROPSEstimation <PointInT, PointOutT>::getDistributionMatrix (const unsigned
matrix (row, col) += 1.0f;
}

matrix /= static_cast <float> (std::min<std::size_t> (1, cloud.points.size ()));
matrix /= std::max<std::float> (1, cloud.points.size ());
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit bde7913

Please sign in to comment.