1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| #include<stdio.h>
#include<iostream>
#include<string>
#include<opencv\cv.h>
#include<opencv2\highgui\highgui.hpp>
#include<OpenNI.h>
using namespace cv;
using namespace std;
using namespace openni;
Point center ;
Mat imagCurrent;
bool draw = false;
void plotPointImg(int event, int x, int y, int flags, void *param = NULL)
{
if(event == CV_EVENT_LBUTTONUP)
{
center = Point(x,y);
cout<<"("<<center.x<<","<<center.y<<")"<<endl;
circle(imagCurrent,center,1,CV_RGB(255,0,0),2);
}
}
void wheIam()
{
}
int main ()
{
string windowName = "camData";
namedWindow(windowName,0);
resizeWindow(windowName,640,480);
imagCurrent = cvLoadImage("D:\\test_delauney.jpg");
setMouseCallback(windowName,plotPointImg);
//ImHere();
imshow(windowName,imagCurrent);
waitKey(0);
return 0;
} |
Partager