diff --git a/keypoints/include/pcl/keypoints/impl/harris_2d.hpp b/keypoints/include/pcl/keypoints/impl/harris_2d.hpp index 19588c456c0..46032a396a5 100644 --- a/keypoints/include/pcl/keypoints/impl/harris_2d.hpp +++ b/keypoints/include/pcl/keypoints/impl/harris_2d.hpp @@ -242,8 +242,7 @@ pcl::HarrisKeypoint2D::detectKeypoints (PointCl } else { - std::sort (indices_->begin (), indices_->end (), - boost::bind (&HarrisKeypoint2D::greaterIntensityAtIndices, this, _1, _2)); + std::sort (indices_->begin (), indices_->end (), [this] (int p1, int p2) { return greaterIntensityAtIndices (p1, p2); }); float threshold = threshold_ * response_->points[indices_->front ()].intensity; output.clear (); output.reserve (response_->size()); diff --git a/keypoints/include/pcl/keypoints/impl/keypoint.hpp b/keypoints/include/pcl/keypoints/impl/keypoint.hpp index 4b84f085430..3baabb6a1b4 100644 --- a/keypoints/include/pcl/keypoints/impl/keypoint.hpp +++ b/keypoints/include/pcl/keypoints/impl/keypoint.hpp @@ -75,16 +75,18 @@ pcl::Keypoint::initCompute () if (surface_ == input_) // if the two surfaces are the same { // Declare the search locator definition - int (KdTree::*radiusSearch)(int index, double radius, std::vector &k_indices, - std::vector &k_distances, unsigned int max_nn) const = &KdTree::radiusSearch; - search_method_ = boost::bind (radiusSearch, boost::ref (tree_), _1, _2, _3, _4, 0); + search_method_ = [this] (int index, double radius, std::vector &k_indices, std::vector &k_distances) + { + return tree_->radiusSearch (index, radius, k_indices, k_distances, 0); + }; } else { // Declare the search locator definition - int (KdTree::*radiusSearchSurface)(const PointCloudIn &cloud, int index, double radius, std::vector &k_indices, - std::vector &k_distances, unsigned int max_nn) const = &KdTree::radiusSearch; - search_method_surface_ = boost::bind (radiusSearchSurface, boost::ref (tree_), _1, _2, _3, _4, _5, 0); + search_method_surface_ = [this] (const PointCloudIn &cloud, int index, double radius, std::vector &k_indices, std::vector &k_distances) + { + return tree_->radiusSearch (cloud, index, radius, k_indices, k_distances, 0); + }; } } } @@ -96,14 +98,18 @@ pcl::Keypoint::initCompute () if (surface_ == input_) // if the two surfaces are the same { // Declare the search locator definition - int (KdTree::*nearestKSearch)(int index, int k, std::vector &k_indices, std::vector &k_distances) const = &KdTree::nearestKSearch; - search_method_ = boost::bind (nearestKSearch, boost::ref (tree_), _1, _2, _3, _4); + search_method_ = [this] (int index, int k, std::vector &k_indices, std::vector &k_distances) + { + return tree_->nearestKSearch (index, k, k_indices, k_distances); + }; } else { // Declare the search locator definition - int (KdTree::*nearestKSearchSurface)(const PointCloudIn &cloud, int index, int k, std::vector &k_indices, std::vector &k_distances) const = &KdTree::nearestKSearch; - search_method_surface_ = boost::bind (nearestKSearchSurface, boost::ref (tree_), _1, _2, _3, _4, _5); + search_method_surface_ = [this] (const PointCloudIn &cloud, int index, int k, std::vector &k_indices, std::vector &k_distances) + { + return tree_->nearestKSearch (cloud, index, k, k_indices, k_distances); + }; } } else diff --git a/keypoints/include/pcl/keypoints/impl/trajkovic_2d.hpp b/keypoints/include/pcl/keypoints/impl/trajkovic_2d.hpp index ae0ba65624d..eea2a5d40c6 100644 --- a/keypoints/include/pcl/keypoints/impl/trajkovic_2d.hpp +++ b/keypoints/include/pcl/keypoints/impl/trajkovic_2d.hpp @@ -207,8 +207,7 @@ pcl::TrajkovicKeypoint2D::detectKeypoints (Poin // Non maximas suppression std::vector indices = *indices_; - std::sort (indices.begin (), indices.end (), - boost::bind (&TrajkovicKeypoint2D::greaterCornernessAtIndices, this, _1, _2)); + std::sort (indices.begin (), indices.end (), [this] (int p1, int p2) { return greaterCornernessAtIndices (p1, p2); }); output.clear (); output.reserve (input_->size ()); diff --git a/keypoints/include/pcl/keypoints/impl/trajkovic_3d.hpp b/keypoints/include/pcl/keypoints/impl/trajkovic_3d.hpp index 150d6d36ff3..4df45523fbc 100644 --- a/keypoints/include/pcl/keypoints/impl/trajkovic_3d.hpp +++ b/keypoints/include/pcl/keypoints/impl/trajkovic_3d.hpp @@ -221,8 +221,7 @@ pcl::TrajkovicKeypoint3D::detectKeypoints (PointCl } // Non maximas suppression std::vector indices = *indices_; - std::sort (indices.begin (), indices.end (), - boost::bind (&TrajkovicKeypoint3D::greaterCornernessAtIndices, this, _1, _2)); + std::sort (indices.begin (), indices.end (), [this] (int p1, int p2) { return greaterCornernessAtIndices (p1, p2); }); output.clear (); output.reserve (input_->size ()); diff --git a/keypoints/include/pcl/keypoints/keypoint.h b/keypoints/include/pcl/keypoints/keypoint.h index 3246934cbd8..38404b62cc2 100644 --- a/keypoints/include/pcl/keypoints/keypoint.h +++ b/keypoints/include/pcl/keypoints/keypoint.h @@ -39,9 +39,9 @@ // PCL includes #include -#include #include #include + #include namespace pcl