April 2017
Beginner to intermediate
250 pages
6h 28m
English
Thanks to OpenCV's FaceRecognizer class, we can identify the person in a photo simply by calling the FaceRecognizer::predict() function on a facial image as follows:
int identity = model->predict(preprocessedFace);
This identity value will be the label number that we originally used when collecting faces for training. For example, 0 for the first person, 1 for the second person, and so on.
The problem with this identification is that it will always predict one of the given people, even if the input photo is of an unknown person or of a car. It would still tell you which person is the most likely person in that photo, so it can be difficult to trust the result! The solution is to obtain ...
Read now
Unlock full access