As simple as it sounds, most of the time it’s a hassle to add the required libraries to your Qt projects. You have to add the include path, the libraries and if you are aiming to have a cross-platform project, you need to account for Windows, macOS and Linux operating systems separately. Well, there are a couple a methods to simplify this a bit which I’ll describe in this tutorial.
In this post I will describe the process of of reading, performing any arbitrary image processing algorithm and displaying an image read from a video file, camera or RTSP feed using OpenCV , and the same time keeping the user interface (created using Qt) responsive.
Here is what you need to add to your Qt qmake projects to be able to add and use OpenCV 3.4.1 default set of libraries. I usually add them into a separate *.pri file and include that in my *.pro files to avoid repetition, but that’s up to you. Well, here it is:
[Updated this post on April 04, 2019, to make sure this tutorial is compatible with OpenCV 4.x and TensorFlow 2.0]
In this post we’re going to learn how to create an image classifier application with a proper GUI that allows the users to choose a camera or a video file as the input and classify the incoming images (video or camera frames) in real time. We’ll be using the power of Qt for cross-platform GUI creation and anything related to visualizing the output and allowing a seamless experience for the user. We’ll also be using TensorFlow and OpenCV to handle the actual classification task, along with accessing cameras and video files.
With the more recent versions of OpenCV, a new module was introduced for handling Deep Learning problems, which is getting better and better by each release. This module is called “dnn” and I recommend getting the latest version of OpenCV (3.4.1 at the time of writing this article) to make sure you face no issues at all (or less issues if any). Using this new module, we can load and use deep learning models from popular 3rd party libraries such as TensorFlow, Caffe, DarkNet and so on. In our example project we’ll use pre-trained TensorFlow models, namely ssd_mobilenet_v1_coco, however, you can easily use other models too if you get a firm grasp on all of the information provided here.
Following a number of questions that appear before me every now and then, I decided to write a post about using CMake to create and build projects using Qt5 and OpenCV 3. For those of you who are qmake fans, using CMake doesn’t mean you can’t use Qt Creator to create and build your projects. In fact, after the release of more recent versions of Qt Creator, CMake support is getting better and better, and it’s fair to say that using CMake with Qt Creator 4.5.1 is almost as easy as using qmake.
In this post I’ll describe how to combine the power of Qt and OpenCV to develop a good looking and fun object detector. The method explained here contains quite a few things to learn and use in your current and future projects, so let’s get started.
It is one thing to become an author, but it is totally another level of joy, to be published by my most favorite publisher in the computer science industry. So, it is with great pleasure that today I can announce that my upcoming book about OpenCV and Qt is available for preordering on Amazon, and also from PacktPub. It’s titled “Computer Vision with OpenCV 3 and Qt5”, and it aims to teach both computer vision and application development for developers who are familiar with C++ (on an intermediate level), but want to learn about powerful cross-platform frameworks such as Qt and OpenCV with hands-on examples and clear instructions. The book is in its final stages of completion, so I’m also excited to announce that our goal is to make it available by the beginning of 2018 and we are working hard to make it happen. Here are the links to preorder:
In this post I’m sharing the required steps for building OpenCV 3.3.X (to be precise, OpenCV 3.3.0 which was released about a week ago) for Android. You can also download the pre-built libraries from here but it’s always a good idea to build the libraries yourself in case you want any special configurations such as Nvidia Carotene, OpenCV World and so on. So here it is:
Many people who have tried OpenCV’s traincascade tool know about a very disturbing error which (at least at the moment) seems to have no good solution, but nevertheless this issue has a solution (even if not convenient) so we need to stick to what we have at hand. My Cascade Trainer GUI app which also uses OpenCV as the underlying framework is also seen to produce this error with many users so I decided to discuss this and share my solution with you all, but please make sure you put your comment below if you’ve got any questions or better suggestions. So, let’s get down to it.