Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[keypoints] Prefer lambdas over bind. #3171

Merged
merged 1 commit into from
Jun 19, 2019

Conversation

SergioRAgostinho
Copy link
Member

No description provided.

@@ -242,8 +242,7 @@ pcl::HarrisKeypoint2D<PointInT, PointOutT, IntensityT>::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); });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/// comparator for responses intensity
bool
greaterIntensityAtIndices (int a, int b) const
{
return (response_->at (a).intensity > response_->at (b).intensity);
}

@@ -207,8 +207,7 @@ pcl::TrajkovicKeypoint2D<PointInT, PointOutT, IntensityT>::detectKeypoints (Poin

// Non maximas suppression
std::vector<int> 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); });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/// comparator for responses intensity
inline bool
greaterCornernessAtIndices (int a, int b) const
{
return (response_->points [a] > response_->points [b]);
}

@@ -221,8 +221,7 @@ pcl::TrajkovicKeypoint3D<PointInT, PointOutT, NormalT>::detectKeypoints (PointCl
}
// Non maximas suppression
std::vector<int> 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); });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/** Comparator for responses intensity
* \return true if \a response_ at index \aa is greater than response at index \ab
*/
inline bool
greaterCornernessAtIndices (int a, int b) const
{
return (response_->points [a] > response_->points [b]);
}

@taketwo taketwo merged commit b5d28c2 into PointCloudLibrary:master Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants