1 | initial version |
setmouseCallback only registers a handler for the window. It doesn't actually call mouse_ev itself. Instead when you click on a point, opencv will call 'mouse_ev' with the event type and the coordinates of the point that was clicked on.
The last argument void* allows you to pass additional arguments to the mouse_ev function when it is called, but it isn't clear from your code how that is happening.