Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you want to pass your image into the function(the last parameter there), like this:

Mat image = imload("blah");
setMouseCallback ( window_name, mouse_ev, &image);

then, later, if you click into the window, the mousehandler gets called, and you can access your image inside it, like:

Mat img = *((Mat *)param);
Vec3b pixel = img.at<Vec3b>(y,x);