Book Image

Computer Vision with OpenCV 3 and Qt5

By : Amin Ahmadi Tazehkandi
4 (1)
Book Image

Computer Vision with OpenCV 3 and Qt5

4 (1)
By: Amin Ahmadi Tazehkandi

Overview of this book

Developers have been using OpenCV library to develop computer vision applications for a long time. However, they now need a more effective tool to get the job done and in a much better and modern way. Qt is one of the major frameworks available for this task at the moment. This book will teach you to develop applications with the combination of OpenCV 3 and Qt5, and how to create cross-platform computer vision applications. We’ll begin by introducing Qt, its IDE, and its SDK. Next you’ll learn how to use the OpenCV API to integrate both tools, and see how to configure Qt to use OpenCV. You’ll go on to build a full-fledged computer vision application throughout the book. Later, you’ll create a stunning UI application using the Qt widgets technology, where you’ll display the images after they are processed in an efficient way. At the end of the book, you’ll learn how to convert OpenCV Mat to Qt QImage. You’ll also see how to efficiently process images to filter them, transform them, detect or track objects as well as analyze video. You’ll become better at developing OpenCV applications.
Table of Contents (19 chapters)
Title Page
Dedication
Packt Upsell
Foreword
Contributors
Preface

Building OpenCV static libraries


Let's start with OpenCV, which follows almost the same set of instructions for building libraries as we did for dynamic libraries. You can refer to Chapter 1, Introduction to OpenCV and Qt, for more information about this. Simply download the source codes, extract, and use CMake to configure your build, as it is mentioned in that chapter. This time though, in addition to checking the checkbox next to the BUILD_opencv_world option, also make sure that all of the following options are turned off by unchecking the checkbox next to each one of them:

  • BUILD_DOCS
  • BUILD_EXAMPLES
  • BUILD_PERF_TESTS
  • BUILD_TESTS
  • BUILD_SHARED_LIBS
  • BUILD_WITH_STATIC_CRT (only available on Windows)

Turning off the first four parameters is merely for speeding up the build process and is completely optional. Disabling BUILD_SHARED_LIBS simply enables the static (non-shared) build mode of OpenCV libraries, and the last parameter (on Windows) helps with avoiding incompatible library files. Now, if...