Now let’s start with lists of mouse events in OPEN CV —

evt=[i for i in dir(cv2) if 'EVENT' in i]
print(evt)

#output
['EVENT_FLAG_ALTKEY', 'EVENT_FLAG_CTRLKEY', 'EVENT_FLAG_LBUTTON', 'EVENT_FLAG_MBUTTON', 'EVENT_FLAG_RBUTTON', 'EVENT_FLAG_SHIFTKEY', 'EVENT_LBUTTONDBLCLK', 'EVENT_LBUTTONDOWN', 'EVENT_LBUTTONUP', 'EVENT_MBUTTONDBLCLK', 'EVENT_MBUTTONDOWN', 'EVENT_MBUTTONUP', 'EVENT_MOUSEHWHEEL', 'EVENT_MOUSEMOVE', 'EVENT_MOUSEWHEEL', 'EVENT_RBUTTONDBLCLK', 'EVENT_RBUTTONDOWN', 'EVENT_RBUTTONUP']

Here we are making list of events you can see events in output.

So, like first two parts we have to import cv2 so that we can work on it. Here we will handle some mouse events on image or video e.g on clicking right button on image etc.

Image for post

#data-science #opencv-python #machine-learning #numpy #data-visualization #python

Handling Mouse Events in OPEN CV
1.05 GEEK