-
-
Save jjtovarl/240939abe25ab1e49609 to your computer and use it in GitHub Desktop.
This file contains 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
#include <opencv2\opencv.hpp> | |
using namespace cv; | |
using namespace std; | |
static void onMouse( int event, int x, int y, int, void* ) | |
{ | |
string msg = "mouse - movido: X = " + to_string(x) + " Y = " + to_string(y); | |
Mat img(200, 650, CV_8UC3); | |
switch (event) | |
{ | |
case CV_EVENT_MOUSEMOVE: | |
putText(img, msg, Point(10,100), 4, 1, CV_RGB(0,255,0), 0, CV_AA ); | |
imshow("Uso del raton", img); | |
break; | |
case CV_EVENT_LBUTTONDOWN : break; | |
case CV_EVENT_RBUTTONDOWN : break; | |
case CV_EVENT_MBUTTONDOWN : break; | |
case CV_EVENT_LBUTTONUP : break; | |
case CV_EVENT_RBUTTONUP : break; | |
case CV_EVENT_MBUTTONUP : break; | |
case CV_EVENT_LBUTTONDBLCLK : break; | |
case CV_EVENT_RBUTTONDBLCLK : break; | |
case CV_EVENT_MBUTTONDBLCLK : break; | |
} | |
} | |
int main( int argc, char** argv ) | |
{ | |
namedWindow( "Uso del raton", 0 ); | |
setMouseCallback( "Uso del raton", onMouse); | |
waitKey(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Se hizo publico