OpenCV comes preinstalled with a range of sophisticated classifiers for general-purpose object detection. These all have very similar APIs and are easy to use, once you know what you are looking for. Perhaps the most commonly known detector is the cascade of Haar-based feature detectors for face detection, which was first introduced by Paul Viola and Michael Jones in their paper Rapid Object Detection using a Boosted Cascade of Simple Features in 2001.
A Haar-based feature detector is a machine learning algorithm that is trained on a lot of positive and negative labeled samples. What will we do in our application is take a pre-trained classifier that comes with OpenCV (you can find the link in the Getting started section). But first, let's take a closer look at how the classifier works.