Local binary patterns

Rajat Anantharam
2 min readDec 27, 2016

--

Local binary patterns (LBP) is a type of visual descriptor used for classification in computer vision. It has since been found to be a powerful feature for texture classification; it has further been determined that when LBP is combined with the Histogram of oriented gradients (HOG) descriptor, it improves the detection performance considerably on some datasets.

With LBP we choose a variable bounding box of pixels for intensity calculation and run the following iterations over the entire image (grayscale)

For example, in the figure below we take the centre pixel (highlighted in red) and threshold it against its neighbourhood of 8 pixels. The neighbour pixel gets a value of 1 if its intensity is lower than the centre pixel, 0 otherwise.

We take the 8-bit binary neighbourhood of the centre pixel and convert it into a decimal representation as shown below.

We repeat the above steps for every pixel of the image. The histogram obtained is the LBP histogram.

This is how sci-image implements LBP

from skimage import featurelbp = feature.local_binary_pattern(image,self.numPoints,self.radius, method="uniform")

--

--

Rajat Anantharam

Android developer working at the biggest online real estate platform in the Netherlands.