The OpenCV library proposes a number of face recognition methods implemented as a subclass of the generic cv::face::FaceRecognizer class. In this recipe, we will examine the cv::face::LBPHFaceRecognizer class, which is interesting to us because it is based on a simple, but often very effective, classification approach, that is, the nearest neighbor classifier.
Moreover, the image representation it uses is built from the LBP feature, which is a very popular way of describing image patterns. Let's take a look at the following steps:
- In order to create an instance of the cv::face::LBPHFaceRecognizer class, its static create method is called as follows:
cv::Ptr<cv::face::FaceRecognizer> recognizer = cv::face::LBPHFaceRecognizer::create(1, ...