Face Recognition using LBPH Algorithm

Sampreethi Bokka
4 min readJun 21, 2021

In computer science, face recognition is basically the task of recognizing a person based on its facial image. It has become very popular in the last two decades, mainly because of the new methods developed and the high quality of the current videos/cameras.

Note that face recognition is different of face detection:

  • Face Detection: it has the objective of finding the faces (location and size) in an image and probably extract them to be used by the face recognition algorithm.
  • Face Recognition: with the facial images already extracted, cropped, resized and usually converted to grayscale, the face recognition algorithm is responsible for finding characteristics which best describe the image.

The face recognition systems can operate basically in two modes:

  • Verification or authentication of a facial image: it basically compares the input facial image with the facial image related to the user which is requiring the authentication. It is basically a 1x1 comparison.
  • Identification or facial recognition: it basically compares the input facial image with all facial images from a dataset with the aim to find the user that matches that face. It is basically a 1xN comparison.

Today we gonna talk about one of the oldest (not the oldest one) and more popular face recognition algorithms: Local Binary Patterns Histograms (LBPH).

Objective

The objective of this post is to explain the LBPH as simple as possible, showing the method step-by-step.

As it is one of the easier face recognition algorithms I think everyone can understand it without major difficulties.

Local Binary Pattern (LBP) is a simple yet very efficient texture operator which labels the pixels of an image by thresholding the neighborhood of each pixel and considers the result as a binary number.

It was first described in 1994 (LBP) and has since been found to be a powerful feature for texture classification. It has further been determined that when LBP is combined with histograms of oriented gradients (HOG) descriptor, it improves the detection performance considerably on some datasets.

Using the LBP combined with histograms we can represent the face images with a simple data vector.

As LBP is a visual descriptor it can also be used for face recognition tasks, as can be seen in the following step-by-step explanation.

Now we are creating a Python program to recognize our face and send mails to your mail id and send messages to whatsapp after recognizing our face through webcam and we will create a new EC2 instance and EBS volume and then attach both using CLI.

Conclusions

  • LBPH is one of the easiest face recognition algorithms.
  • It can represent local features in the images.
  • It is possible to get great results (mainly in a controlled environment).
  • It is robust against monotonic gray scale transformations.
  • It is provided by the OpenCV library (Open Source Computer Vision Library).

!!!Thanks for reading this article!!!

--

--

Sampreethi Bokka

Intern at LinuxWorld informatics Pvt Ltd student from vellore institute of technology.