SHARE
TWEET

Untitled

a guest Jul 17th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int n=4;
  2.    int TOTAL_POINTS=n;
  3. Point pt;
  4. vector<Point> capturePoint = vector<Point>();
  5.  
  6. void CallBackFunc(int event, int x, int y, int flags, void* param)
  7. {
  8.     //Mat& image= *(Mat*) param;
  9.  
  10.     if (event == CV_EVENT_LBUTTONDOWN){
  11.         pt.x = x;
  12.         pt.y = y;
  13.         cout << "Point" << TOTAL_POINTS + 1 - n << "(" << x << "," << y << ")" << endl;
  14.         capturePoint.push_back(pt);
  15.         n--;
  16.         //circle(mouseDetector::workingMat,pt,2,Scalar(0,0,255), 5);
  17.         if(n==0){
  18.            cvDestroyAllWindows();
  19.         }
  20.     }
  21. }
RAW Paste Data
Top