Mouse event handling with cvSetMouseCallback

前端 未结 2 532
长情又很酷
长情又很酷 2021-01-12 17:47

I am writing a code for eye tracker using OS X / X Code / OpenCV 2.2. As part of the Eye Tracker training process, I am using cvSetMouseCallback to capture the data as per f

相关标签:
2条回答
  • 2021-01-12 18:09

    try to remove this line:

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

    from the loop and place it immediately after:

    cvNamedWindow( "video", 1 );
    

    Regards !

    0 讨论(0)
  • 2021-01-12 18:15

    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.

    0 讨论(0)
提交回复
热议问题