In the preceding section, we learned how to train and use cascade classifiers to detect objects. But that approach, compared to the increasingly expanding deep learning approach, provides worse performance, both in terms of the recall rate and accuracy. The OpenCV library has started to move on to the deep learning approach already. In version 3.x, it introduced the Deep Neural Network (DNN) module, and now in the latest version, v4.x, we can load many formats of neural network architecture, along with the pretrained weights for them. Also, as we mentioned, the tools for training cascade classifiers are deprecated in the latest version.
In this section, we will move on to the deep learning approach to see how to use OpenCV to detect objects the deep learning way. We used this approach once already. In Chapter 5, Optical Character Recognition...