Local binary patterns transformπ
Converts each pixel of an input image to a local binary pattern (LBP) code. The special case of eight samples with a radius of one is also known as the census transform.
Inputsπ
image
: Input image. If a color image is input, its intensity will be used.interpolation
: Iftrue
, improve accuracy by calculating the intensity of neighborhood samples in subpixel accuracy. Iffalse
, round pixel coordinates to the nearest integer. Notice that interpolation is a significantly slower operation than rounding.samples
: The number of neighborhood samples.radius
: The radius of a local neighborhood, in pixels.noiseThreshold
: A local threshold for cancelling out noise. Bits in the local pattern will turn one only if their intensity difference to the center of the pattern exceeds the threshold.mode
: The mode of operation.
Outputsπ
image
: Transformed, graylevel image. The binary value of the intensity of a pixel represents an LBP code. The output image lacks a border of radius pixels on all sides because the LBP code for these pixels would be undefined. The maximum value of the output image and hence the number of bits per pixels depends on samples and mode.

enum
Mode
π The operation mode of the LBP.
Values:

enumerator
Standard
π The output image has up to (2^N) different LBP codes where N is the number of neighborhood samples.

enumerator
Uniform
π Only βuniformβ binary codes are accepted.
All other pixels are mapped into a single βmiscellaneousβ LBP code. This reduces the number of possible LBP codes significantly and increases robustness in some applications. Uniform binary codes are binary numbers that have at most two 1to0 or 0to1 transitions in their circularly interpreted binary representation. For example, the 8bit binary number 10000011 is uniform whereas 10000101 is not.

enumerator
RotationInvariant
π Each code is rotated to its minimum value so that rotation of the image does not (ideally) change the result.
This reduces the number of codes. For example, the 8bit codes 11100000, 01110000, and 00111000 would all become 00000111.

enumerator
UniformRotationInvariant
π Like
RotationInvariant
, but only uniform codes are accepted.This results in a short, rotation invariant feature vector.

enumerator
Symmetric
π An LBP operator that compares opposing pairs of pixels in a circular neighborhood and ignores the center.
The advantage is that only N/2 comparisons per pixel are needed compared to N comparisons in the original LBP operator. Furthermore, the length of the (standard) feature vector will be (2^{N/2}) instead of (2^N), which makes classification faster. Unfortunately, there is no free lunch. The symmetric version cannot be made rotation invariant as easily as the basic LBP. Its classification accuracy may also be somewhat worse. Uniform patterns and rotation invariance lose their meaning with the symmetric LBP.

enumerator