March 2019
Intermediate to advanced
538 pages
13h 38m
English
The deep learning OpenCV module is found under the opencv2/dnn.hpp header, which we have to include in our source header and in cv::dnn namespace.
Then our header for OpenCV must look like this:
...#include <opencv2/core.hpp>#include <opencv2/dnn.hpp>#include <opencv2/imgproc.hpp>#include <opencv2/highgui.hpp>using namespace cv;using namespace dnn;...
The first thing we have to do is import the COCO name's vocabulary, which is in the coco.names file. This file is a plaintext file that contains one class category per line, and is ordered in the same way as the confidence results. Then we are going to read each line of this file and store it in a vector of strings, called classes:
... int main(int argc, char** argv) ...