Book Image

Qt 5 and OpenCV 4 Computer Vision Projects

By : Zhuo Qingliang
4 (1)
Book Image

Qt 5 and OpenCV 4 Computer Vision Projects

4 (1)
By: Zhuo Qingliang

Overview of this book

OpenCV and Qt have proven to be a winning combination for developing cross-platform computer vision applications. By leveraging their power, you can create robust applications with both an intuitive graphical user interface (GUI) and high-performance capabilities. This book will help you learn through a variety of real-world projects on image processing, face and text recognition, object detection, and high-performance computing. You’ll be able to progressively build on your skills by working on projects of increasing complexity. You’ll begin by creating an image viewer application, building a user interface from scratch by adding menus, performing actions based on key-presses, and applying other functions. As you progress, the book will guide you through using OpenCV image processing and modification functions to edit an image with filters and transformation features. In addition to this, you’ll explore the complex motion analysis and facial landmark detection algorithms, which you can use to build security and face detection applications. Finally, you’ll learn to use pretrained deep learning models in OpenCV and GPUs to filter images quickly. By the end of this book, you will have learned how to effectively develop full-fledged computer vision applications with OpenCV and Qt.
Table of Contents (11 chapters)

About real time

When we handle videos, either video files or real-time video feeds from cameras, we know that the frame rate of the videos is about 24-30 FPS in general. That means we have 33-40 milliseconds to process each frame. If we take more time than that, we will lose some frames from a real-time video feed, or get a slower playing speed from a video file.

Now, let's add some code to our application to measure how much time we spend on each frame while detecting objects. First, in the Detective.pro project file, we add a new macro definition:

DEFINES += TIME_MEASURE=1

We will use this macro to switch the time-measuring code on or off. If you want to turn off the time measuring, just comment this line out, then rebuild the application by running the make clean && make command.

Then, in the CaptureThread::run method, in the capture_thread.cpp file, we add some...