Created
November 12, 2014 13:55
-
-
Save helxsz/180b07a7939857e35183 to your computer and use it in GitHub Desktop.
dddd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
other = imread(path2, CV_LOAD_IMAGE_COLOR); cvtColor(other, other, CV_RGB2GRAY); other(ROI).copyTo(other_target); | |
namedWindow( "reference", WINDOW_AUTOSIZE ); | |
//setMouseCallback("reference",on_mouse, NULL ); ; | |
imshow( "reference", ref ); | |
void on_mouse( int event, int x, int y, int d, void *ptr ) | |
{ | |
if ( event == EVENT_LBUTTONDOWN ) | |
{ | |
cout << "Left button of the mouse is clicked - position (" << x << ", " << y << ")" << endl; | |
} | |
else if ( event == EVENT_RBUTTONDOWN ) | |
{ | |
cout << "Right button of the mouse is clicked - position (" << x << ", " << y << ")" << endl; | |
} | |
else if ( event == EVENT_MBUTTONDOWN ) | |
{ | |
cout << "Middle button of the mouse is clicked - position (" << x << ", " << y << ")" << endl; | |
} | |
else if ( event == EVENT_MOUSEMOVE ) | |
{ | |
cout << "Mouse move over the window - position (" << x << ", " << y << ")" << endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment