O'Reilly logo

Learn OpenCV 4 by Building Projects - Second Edition by Prateek Joshi, Vinicius G. Mendonca, David Millan Escriva

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding slider and mouse events to our interfaces

Mouse events and slider control are very useful in computer vision and OpenCV. Using these control users, we can interact directly with the interface and change the properties of the input images or variables. In this section, we are going to introduce the mouse events and slider controls for basic interactions. To facilitate proper understanding, we have created the following code, by means of which we are going to paint green circles in an image, using mouse events, and blur the image with the slider:

// Create a variable to save the position value in track int blurAmount=15; // Trackbar call back function static void onChange(int pos, void* userInput); //Mouse callback static void onMouse(int ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required