Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to handle mouse wheel event in OpenCV?

Hello,

All is in the title: how to manage an event of mouse wheel on OpenCV ?

Here is my task : I would like to write a program that displays an image in OpenCV window. I click anywhere in the image to define the " upper left" corner of a square that I want to draw, and with the mouse wheel , I draw while controlling the size of his side .

It's that simple , but difficult to find out how. For now , the wheel gave me a zoom, so .. Event exists somewhere but I did find the following event:

CV_EVENT_MOUSEMOVE - When the mouse pointer moves over the specified window CV_EVENT_LBUTTONDOWN - When the left button of the mouse is pressed on the specified window CV_EVENT_RBUTTONDOWN - When the right button of the mouse is pressed on the specified window CV_EVENT_MBUTTONDOWN - When the middle button of the mouse is pressed on the specified window CV_EVENT_LBUTTONUP - When the left button of the mouse is released on the specified window CV_EVENT_RBUTTONUP - When the right button of the mouse is released on the specified window CV_EVENT_MBUTTONUP - When the middle button of the mouse is released on the specified window

hoping to find an answer , Thank you for your help,