# What is Local binary patterns

##### Understanding Local Binary Patterns (LBP)

Local Binary Patterns (LBP) is a computer vision algorithm to extract significant features from an image. It was first proposed by Ojala, Pietikainen, and Maenpaa in 1994. Since then, LBP has been widely used in various computer vision applications like facial recognition, object detection, texture analysis, and more. In this article, we will cover the basics of LBP, its working mechanism, types, and applications.

##### Working Mechanism of LBP

LBP encodes the relative spatial relationship between the center pixel and its neighbors by comparing their intensities and creating a binary pattern. The binary value is one if the neighbor's intensity is greater than or equal to the central pixel's intensity, and zero otherwise.

For example, Let's take a 3 x 3 window around pixel P and the intensity values of its neighbors are { 2, 3, 5, 4, 1, 7, 8, 6}. We compare each neighbor's intensity value with P's intensity, and if the neighbor intensity is more significant or equal to P, then assign the binary value one, and zero otherwise.

Now we will get an 8-bit pattern in binary like {01000110}. Then we convert this binary value into decimal. The obtained decimal value is the LBP value for pixel P.

##### Types of LBP

There are mainly three types of LBP are available. They are:

• Original LBP
• Uniform LBP
• Rotation Invariant LBP
##### Original LBP

The original LBP is the most basic type of LBP. In this method, we encode the neighbors' intensity values by comparing them with the central pixel, create a binary pattern, and convert it into decimal. It produces a non-uniform histogram, where the distribution of values varies throughout the image.

##### Uniform LBP

The uniform LBP types code the neighbors' intensity values to create a binary pattern in a way that no more than two bitwise transitions (0 to 1 or 1 to 0) occur when going from the most significant bit to the least significant.

This is useful because uniform LBP encodings are highly discriminative. That is, they can capture the essential features of the image while being resistant to noise and other unwanted artifacts. It produces a uniform histogram, where all the values in the histogram are almost identical throughout the image.

##### Rotation Invariant LBP

The rotation invariant LBP types improve the LBP method to be invariant to rotations. In ordinary LBP, the patterns are sensitive to rotation. For instance, if an image is rotated, the LBP value for each pixel will be different. This is because the reference point for encoding is the central pixel.

To deal with this issue, we select a rotation-invariant neighborhood around the central pixel using symmetric points. Then we consider the binary pattern created from this neighborhood and convert it into decimal. It produces a rotation-invariant histogram, where the LBP value remains the same even after the image's rotation.

##### Applications of LBP

LBP has many applications in computer vision. Here are some of them.

• Face Recognition: LBP is an extremely powerful tool in facial recognition, where it helps in identifying the unique facial texture patterns.
• Texture Analysis: LBP is very useful for texture analysis. It can be applied in multiple fields, such as product quality inspection and disease diagnosis.
• Object Detection: LBP is used in object detection for detecting and classifying objects in an image.
• Gait Recognition: LBP can be used in gait recognition. It is a non-intrusive biometric method that identifies people based on the pattern of their walking.
• Medical Diagnosis: LBP can be used to extract useful features from medical images for diagnosis purposes.
##### Conclusion

In conclusion, the local binary pattern (LBP) is an important algorithm in the field of computer vision. It is used widely in various applications like facial recognition, object detection, texture analysis, and more. LBP transforms the image into texture patterns that are good enough for recognition while being robust to noise. Various types of LBP can be used based on the requirement of the application.