Skip to content

Instantly share code, notes, and snippets.

@jjtovarl
Forked from devcarmelo/mouse.cpp
Last active August 29, 2015 14:14
Show Gist options
  • Save jjtovarl/240939abe25ab1e49609 to your computer and use it in GitHub Desktop.
Save jjtovarl/240939abe25ab1e49609 to your computer and use it in GitHub Desktop.
#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;
}
@jjtovarl
Copy link
Author

copia del código en la red.

@jjtovarl
Copy link
Author

Se hizo publico

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment