opencv - Not able to use std::sort with Android NDK -


ndk-build complains std::sort() has wrong arguments , in same message can't found. ndk use other function?

candidate expects 2 arguments, 3 provided sort(centroids.begin() + * 10, centroids.begin() + (i + 1) * 10, pointxgreater);

error: no matching function call 'sort(__gnu_cxx::__normal_iterator*, std::vector > >, __gnu_cxx::__normal_iterator*, std::vector > >, removeconvexity(cv::mat, cv::mat, cv::mat)::&)'

for (int = 0; < 10; i++) {     sort(centroids.begin() + * 10, centroids.begin() + (i + 1) * 10, pointxgreater); } 

thats function call.

vector<cv::point> centroids; centroids.reserve(100);  (int = 0; < contours.size(); i++) {     vector<cv::point> contour = contours.at(i);     moments mom = moments(contour);     cv::point center = cv::point(int(mom.m10 / mom.m00), int(mom.m01 / mom.m00));     centroids.push_back(center); }  std::reverse(centroids.begin(), centroids.end());  struct {     bool operator()(const cv::point p1, const cv::point p2) {         return p1.x < p2.x;     } } pointxgreater; 

somehow able compile once. problem came back.

static bool pointxgreater(const cv::point p1, const cv::point p2)  {      return p1.x < p2.x;  }  (int = 0; < 10; i++)  {     sort(centroids.begin() + * 10, centroids.begin() + (i + 1) * 10, pointxgreater);  } 

that solved problem.


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -