In this section, you will learn how to perform dynamic drawing using mouse events. We are going to see some examples in increasing order of complexity.
Dynamic drawing with mouse events
Drawing dynamic shapes
Th next example gives you an introduction into how to handle mouse events with OpenCV. The cv2.setMouseCallback() function performs this functionality. The signature for this method is as follows:
cv2.setMouseCallback(windowName, onMouse, param=None)
This function establishes the mouse handler for the window named windowName. The onMouse function is the callback function, which is called when a mouse event is performed (for example, double-click, left-button down, left-button up, among others). The optional param parameter...