In order to understand the functioning of the face recognition approach presented in this recipe, we need to explain its two main components – the image representation that is used, and the classification method that is applied.
As its name indicates, the cv::face::LBPHFaceRecognizer algorithm makes use of the LBP feature. This is a contrasting and unique way of describing the image patterns present in an image. It is a local representation that transforms every pixel into a binary representation by encoding the pattern of image intensities found in a neighborhood. To achieve this goal, a simple rule is applied; a local pixel is compared to each of its selected neighbors. If its value is greater than that of its neighbor, ...