Skip to content

Instantly share code, notes, and snippets.

@keithshep
Created September 27, 2014 03:16
Show Gist options
  • Save keithshep/2018f3b56dbfdd00edb1 to your computer and use it in GitHub Desktop.
Save keithshep/2018f3b56dbfdd00edb1 to your computer and use it in GitHub Desktop.
c++ cheats
// creating a priority queue with a lambda less operator
auto pt_less = [&mat](const cv::Point& pt1, const cv::Point& pt2) -> bool {
return mat.at<uint8_t>(pt1) < mat.at<uint8_t>(pt2);
};
priority_queue<cv::Point, vector<cv::Point>, decltype(pt_less)> erosion_candidates(pt_less);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment