▶Book Description
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.
▶What You Will Learn
- Create an image viewer with all the basic requirements
- Construct an image editor to filter or transform images
- Develop a security app to detect movement and secure homes
- Build an app to detect facial landmarks and apply masks to faces
- Create an app to extract text from scanned documents and photos
- Train and use cascade classifiers and DL models for object detection
- Build an app to measure the distance between detected objects
- Implement high-speed image filters on GPU with Open Graphics Library (OpenGL)
▶Key Features
- Gain practical insights into code for all projects covered in this book
- Understand modern computer vision concepts such as character recognition, image processing and modification
- Learn to use a graphics processing unit (GPU) and its parallel processing power for filtering images quickly
▶Who This Book Is For
This book is for engineers and developers who are familiar with both Qt and OpenCV frameworks and are capable of creating simple projects using them, but want to build their skills to create professional-level projects using them. Familiarity with the C++ language is a must to follow the example source codes in this book.
▶What this book covers
- Chapter 1, Building an Image Viewer, covers building our first application with Qt. We will build an image viewer, with which we can browse images in a folder. We'll also be able to zoom in or out of the image while viewing it.
- Chapter 2, Editing Images Like a Pro, combines the Qt library and the OpenCV library to build a new application, an image editor. In this chapter, we will start by blurring an image to learn how to edit an image. Then, we will learn how to use many other editing effects, such as eroding, sharpening, cartoon effects, and geometric transformation. Each of these features will be incorporated as a Qt plugin, so the plugin mechanism of the Qt library will also be covered.
- Chapter 3, Home Security Applications, covers building an application for home security. With a webcam, this application can detect motion and send notifications to a mobile phone upon motion being detected. We will learn how to deal with cameras and videos, how to analyze motion and detect movement with OpenCV, and how to send notifications via IFTTT in this chapter.
- Chapter 4, Fun with Faces, explores how to detect faces and facial landmarks with OpenCV. We will build an application to detect faces and facial landmarks in the video in real time in this chapter, and, with the facial landmarks detected, we will apply some funny masks to the faces.
- Chapter 5, Optical Character Recognition, introduces the Tesseract library to you. With the help of this library, we will extract text from images such as photos of book pages and scanned documents. In order to extract text from photos of common scenes, we will use a deep learning model named EAST to detect the text areas in photos, and then pass those areas to the Tesseract library. In order to extract text on the screen conveniently, we will also learn how to grab the screen as an image with the Qt library.
- Chapter 6, Object Detection in Real Time, shows how to use cascade classifiers to detect objects. Besides using pretrained classifiers, we will also learn how to train classifiers by ourselves. Then, we will introduce how to detect objects by using deep learning models, and a model named YOLOv3 will be used to demonstrate the usage of this approach.
- Chapter 7, Real-Time Car Detection and Distance Measurement, covers creating an application to detect cars and measure distances. In the application, we will learn how to measure distances between objects from a bird's eye view and how to measure distances between objects and the camera at eye level view.
- Chapter 8, Using OpenGL for High-Speed Filtering of Images, the final chapter of the book, introduces an approach to heterogeneous computing. In this chapter, we first have a brief introduction to the OpenGL specification, and then use it to filter images on the GPU. This is not a typical way to use OpenGL, and it is not typical to do heterogeneous computing either, so we can refer to OpenCL or CUDA if we want to do heterogeneous computing in a mature way.
- Appendix A, Assessments, contains answers to all the assessment questions.