Hi i am new to Opencv and i try to integrate square.cpp with opencv this is working fine. Now i want to sort squares type is "vector>" based on "Y". I got this link How to Sort Vector of Points Based on a Y-Axis? and include now it gives following error.
" No matching function for call to object of type 'myClass'"
This the code i am wrote:
#include <algorithm>
using namespace std;
using namespace cv;
struct sortClass
{
public:
bool operator()(cv::Point pt1, cv::Point pt2) { return (pt1.y < pt2.y);}
} classObj;
static Vector<Point> findHeader(vector<vector<Point> >& squares)
{
Vector<Point> Header;
std::sort(squares.begin(), squares.end(), classObj);
for( size_t i = 0; i < squares.size(); i++ )
{
cout <<"sorted ==>"<<squares[i] <<endl;
}
return Header;
}