O'Reilly logo

Learning Image Processing with OpenCV by Gloria Bueno García, Oscar Deniz Suarez, José Luis Espinosa Aranda, Jesus Salido Tercero, Ismael Serrano Gracia, Noelia Vállez Enano

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

User-interactions tools

In the previous sections, we explained how to create (namedWindow) a window to display (imshow) an image and fetch/handle events (waitKey). The examples we provide show you a very easy method for user interaction with OpenCV applications through the keyboard. The waitKey function returns the code of a key pressed before a timeout expires.

Fortunately, OpenCV provides more flexible ways for user interaction, such as trackbars and mouse interaction, which can be combined with some drawing functions to provide a richer user experience. Moreover, if OpenCV is locally compiled with Qt support (the WITH_QT option of CMake), a set of new functions are available to program an even better UI.

In this section, we provide a quick review ...

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