user facing application, neither the native UI nor the Qt-based interface are going to do it. In this section,
we will (very) briefly explore some of the issues and techniques for working with OpenCV and two
existing toolkits: wxWidgets and Qt.
Clearly there are countless UI toolkits out there, and we would not want to waste time digging into each of
them. Having said that, it is useful to explore how to handle the issues which will arise if you want to use
OpenCV with a more fully featured toolkit.
The primary issue is how to convert OpenCV images to the form that the toolkit expects for graphics, and
to know which widget or component in the toolkit is going to do that display work for you. From there, you
don’t need much else that is specific to OpenCV. Notably, you will not need or want the features of the UI
toolkits we have covered in this chapter.
An Example of OpenCV and Qt
Here we will show an example of using the actual Qt toolkit to write a program that reads a video file and
displays it on the screen. There are several subtleties, some of which have to do with how one uses Qt, and
others to do with OpenCV. Of course, we will focus on the latter, but it is worth taking a moment to notice
how the former affect our current goal.
Below is the top-level code for our example; it just creates a Qt application and adds our QMoviePlayer
widget. Everything inte ...