Using OpenCV's highgui module
The highgui
module has been designed to provide an easy way to visualize the results and try the functionality of developed applications with OpenCV. As we saw in the previous chapter, this module supplies functions to perform the following operations:
- Reading images and videos from files and live cameras (
imread
) through aVideoCapture
object. - Writing images and videos from memory to disk (
imwrite
) through aVideoWriter
object. - Creating a window that can display images and video frames (
namedWindow
andimshow
). - Fetching and handling events when a key is pressed (
waitKey
).
Of course, the module contains more functions to enhance the user interaction with the software applications. Some of them will be explained in this chapter. In the following tbContrast
code example, we can read an image file and two windows are created: the first one shows the original image and the other is the resulting image after increasing or decreasing the contrast to the original...