Passing multiple parameters with the setMouseCallback function
Is it possible to do?
As of know I am using the following to pass an image to the callback:
static void onMouse( int event, int x, int y, int, void* param)
{
// Mount back the parameters
Mat* ptrImage = (Mat*)param;
//What to do when left button is pressed
if( event != EVENT_LBUTTONDOWN ){
// Draw the point on the image here!
return;
}
}
namedWindow("draw mask", WINDOW_AUTOSIZE);
setMouseCallback("draw mask", onMouse, (void*)&work_image);
But I would like to add a second pointer to a vector of points to keep storing them also, just don't know how to add multiple parameters. Anyone has any idea without creating global variables?
i edited this question because i wanted it to be on top of the list and seen again. if you think that this post has some useful information please upvote the question and the answer. by this way you will help others to find useful informations in this forum.