Mouse event handling with cvSetMouseCallback

为君一笑 提交于 2019-12-01 05:01:04

try to remove this line:

cvSetMouseCallback( "video", my_mouse_callback, (void*) img);

from the loop and place it immediately after:

cvNamedWindow( "video", 1 );

Regards !

ERH

I can see that this is an old post, but for people looking for help in the future: I had a similar problem using opencv (in python) and this answer helped me out. In short, the flags value returned from right clicking did not match the value returned from CV_EVENT_RBUTTONDOWN; printing the flags value that you get when you right click and comparing it to the flags value stored in CV_EVENT_RBUTTONDOWN to see if they're the same may help.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!