Skip to content

Instantly share code, notes, and snippets.

@helxsz
Created November 12, 2014 13:55
Show Gist options
  • Save helxsz/180b07a7939857e35183 to your computer and use it in GitHub Desktop.
Save helxsz/180b07a7939857e35183 to your computer and use it in GitHub Desktop.
dddd
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