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 ...