Python OpenCV
About Lesson

In this lesson we are going to learn about Python OpenCV Working Mouse Events, basically in this lesson we want to learn by clicking the mouse draw circle or rectangle.

 

 

This is the complete code for this lesson.

 

 

 

First we need to create an empty image using Numpy.

 

 

So in here we are checking, if we double press the left mouse button, we want to draw rectangle or circle, there are different mouse buttons that we can use, in here we want to use left mouse button.

 

 

 

If you run the code and double press the left mouse button you will see the circle.

Python OpenCV Working Mouse Events
Python OpenCV Working Mouse Events