pull/1938/merge
indianocean10000 2 months ago committed by GitHub
commit 8760c0d576
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 30
      modules/ximgproc/src/selectivesearchsegmentation.cpp

@ -49,7 +49,7 @@ namespace cv {
// Helpers // Helpers
// Represent a regsion // Represent a region
class Region { class Region {
public: public:
int id; int id;
@ -70,30 +70,26 @@ namespace cv {
// Comparator to sort cv::rect (used for a std::map). // Comparator to sort cv::rect (used for a std::map).
struct rectComparator { struct rectComparator {
bool operator()(const cv::Rect_<int>& a, const cv::Rect_<int>& b) const { bool operator()(const cv::Rect_<int>& a, const cv::Rect_<int>& b) const {
if (a.x < b.x) { if (a.x < b.x)
return true; return true;
} else if (a.x > b.x)
if (a.x > b.x) {
return false; return false;
}
if (a.y < b.y) { if (a.y < b.y)
return true; return true;
} else if (a.y > b.y)
if (a.y > b.y) {
return false; return false;
}
if (a.width < b.width) { if (a.width < b.width)
return true; return true;
} else if (a.width > b.width)
if (a.width > b.width) {
return false; return false;
}
if (a.height < b.height) { if (a.height < b.height)
return true; return true;
} else if (a.height > b.height)
if (a.height > b.height) {
return false; return false;
}
return false; return false;
} }
}; };

Loading…
Cancel
Save