Hello,
I have just started working with opencv in python for my undergrad thesis. Im Trying to build a simple GUI which supports mouse inputs on an image. This is fairly simple in C and C++ , since there are tons of documentations for opencv funtions in that area.
Anyway here is the problem.
Im trying to create a mouse listener which is shown like this in the API
the problem in python is that there is no pointers so how can I give, the on_mouse handler function that I have written to the cvMouseHandlerC allback funtion as the param are not set.
when i give the function name I get the error:
> argument 2 of type 'CvMouseCallbac k'
and yes I know python is type free. Any Ideas???
Thanks.
I have just started working with opencv in python for my undergrad thesis. Im Trying to build a simple GUI which supports mouse inputs on an image. This is fairly simple in C and C++ , since there are tons of documentations for opencv funtions in that area.
Anyway here is the problem.
Im trying to create a mouse listener which is shown like this in the API
Code:
void cvSetMouseCallback( const char* window_name, CvMouseCallback on_mouse );
window_name
Name of the window.
on_mouse
Pointer to the function to be called every time mouse event occurs in the specified window. This function should be prototyped as
void Foo(int event, int x, int y, int flags);
where event is one of CV_EVENT_*
when i give the function name I get the error:
> argument 2 of type 'CvMouseCallbac k'
and yes I know python is type free. Any Ideas???
Thanks.
Comment