title: What is the best way to search/find a point in a vector of points?
body: <p>I tried to sort the points based on their x coordinates and do a binary search on the vector but I cannot find the points that I know they exist.</p>
  
  <p>Thanks for your help.</p>
  
  <pre><code>struct PointSort {
      bool operator() (cv::Point pt1, cv::Point pt2) { return (pt1.x &lt; pt2.x);}
  } mySort;
  
  .
  .
  .
  std::sort (temp.begin(), temp.end(), mySort);
  if (std::binary_search(temp.begin(), temp.end(), somePoint, mySort)){
      doSomething();
  }
  </code></pre>