Using Qt-based functions
While highgui
will be sufficient for most purposes, the Qt UI framework (available at http://qt-project.org/) can be leveraged in OpenCV to develop richer user interfaces. A number of OpenCV's user interface functions use the Qt library behind the scenes. In order to use these functions, OpenCV must have been compiled with the WITH_QT
option.
Note that Qt is a class and widget library that allows the creation of full-fledged applications with rich, event-driven user interfaces. In this section, however, we will mainly focus on specific Qt-based functions within OpenCV. Programming with Qt is out of the scope of this book.
With Qt support on, windows created with the namedWindow
function will automatically look like what is shown in the following screenshot. There is a toolbar with useful functions such as pan, zoom, and save image. Windows also display a status bar at the bottom with the current mouse location and RGB value under that pixel. Right-clicking on...