Python和opencv
你好,
我刚刚开始在我的本科生论文中使用python语言中的OpenCV.我正在尝试建立一个简单的图形用户界面,支持鼠标在图像上的输入.这在C和C++中相当简单,因为在这一领域有大量关于OpenCV函数的文档.
不管怎么说,问题就在这里.
我正在尝试创建一个鼠标监听程序,如API中所示
选择 | 换行 | 行号
- 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_*
Python中的问题是没有指针,所以我如何才能给出,我编写给cvMouseHandlerCallback函数的on_ouse处理程序函数,因为参数没有设置.
当我给出函数名时,我得到错误:
>'CvMouseCallback'类型的参数2
是的,我知道Python是自由类型的.有什么想法吗?
谢谢.