Recognizing faces using nearest neighbors of local binary patterns
Our first exploration of machine learning techniques will start with what is probably the simplest approach, namely nearest neighbor classification. We will also present the local binary pattern feature, a popular representation encoding the textural patterns and contours of an image in a contrast independent way.
Our illustrative example will concern the face recognition problem. This is a very challenging problem that has been the object of numerous researches over the past 20 years. The basic solution we present here is one of the face recognition methods implemented in OpenCV. You will quickly realize that this solution is not very robust and works only under very favorable conditions. Nevertheless, this approach constitutes an excellent introduction to machine learning and to the face recognition problem.
How to do it...
The OpenCV library proposes a number of face recognition methods implemented as a subclass of the generic...