You are on page 1of 22

Local Binary Pattern

Dr.G.Malathi
Local Binary Pattern
• Local binary patterns (LBP) -- visual descriptor
used for classification in computer vision.
• LBP was first described in 1994
• Powerful feature for texture classification;
• Used successfully in the background
subtraction process.
LBP
• Wide range of applications
• Face detection
• Texture classification
• Object detection system
How does LBP works?
• Each 3x3 window in the image is processed to
extract LBP code
• The processing involves thresholding the
centre pixel of that window with surrounding
pixels using the window mean, window
median or the actual centre pixel as
thresholds
LBP
LBP
5 9 1 i0 i1 12

4 4 6 17 ic 13

7 2 3 16 15 14
LPB
5 9 1 i0 i1 12

4 4 6 17 ic 13

7 2 3 16 15 14
LPB
(5 – (9 – (1 – i0 i1 12
4)*2^0 4)*2^1 4)*2^2

(4 – 4 (6 – 17 ic 13
4)*2^7 4)*2^3

(7 – (2 – (3 – 16 15 14
4)*2^6 4)*2^5 4)*2^4
LPB
(5 – (9 – (1 – i0 i1 12
4)*2^0 4)*2^1 4)*2^2

(4 – 4 (6 – 17 ic 13
4)*2^7 4)*2^3

(7 – (2 – (3 – 16 15 14
4)*2^6 4)*2^5 4)*2^4
LPB
(1)*2^0 (5)*2^1 (-3)*2^2 i0 i1 12

(0)*2^7 4 (2)*2^3 17 ic 13

(3)*2^6 (-4)*2^5 (-1)*2^4 16 15 14


LPB
(1)*2^0 (5)*2^1 (-3)*2^2 i0 i1 12
1 10 negative

(0)*2^7 4 (2)*2^3 17 ic 13
0 postive

(3)*2^6 (-4)*2^5 (-1)*2^4 16 15 14


positve negative negative
LPB
1 1 0 i0 i1 12

1 1 17 ic 13

1 0 0 16 15 14
LPB
1 1 0 i0 i1 12

1 1 17 ic 13

1 0 0 16 15 14

1 1 0 1 0 0 1 1
7 6 5 4 3 2 1 0
1*2^7 1*2^6 0 1*2^4 0 0 1*2^1 1*2^0

Adding these gives a decimal value and that should be the central pixel value
LBP
5-4 9-4 1-4 i0 i1 12

4-4 4 6-4 17 ic 13

7-4 2-4 3-4 16 15 14


LBP
1 5 -3 i0 i1 12

0 4 2 17 ic 13

3 -4 3-4 16 15 14
Generate binary values for each
neighbour
5 9 1 i0 i1 12

4 4 6 17 ic 13

7 2 3 16 15 14
LBP
• Convert the binary value into the decimal
value which gets the central value
LBP
• The original LBP operator forms labels for the
image pixels by thresholding the 3 x 3
neighborhood of each pixel with the center
value and considering the result as a binary
number.
• The histogram of these 28 = 256 different
labels can then be used as a texture
descriptor.
Uniform Pattern
Uniform Pattern
– used to reduce the length of the feature vector and
implement a simple rotation invariant descriptor
– This idea is motivated by the fact that some binary
patterns occur more commonly in texture images than
others.
– A local binary pattern is called uniform if the binary
pattern contains at most two 0-1 or 1-0 transitions.
– For example, 00010000(2 transitions) is a uniform
pattern, 01010100(6 transitions) is not.
Uniform Pattern
– LBP histogram computation
• Two bins – 1 for every Uniform pattern and 1 for all
non-uniform patterns
• Using uniform patterns, the length of the feature vector
for a single cell reduces from 256 to 59.
• The 58 uniform binary patterns correspond to the
integers 0, 1, 2, 3, 4, 6, 7, 8, 12, 14, 15, 16, 24, 28, 30,
31, 32, 48, 56, 60, 62, 63, 64, 96, 112, 120, 124, 126,
127, 128, 129, 131, 135, 143, 159, 191, 192, 193,
195, 199, 207, 223, 224, 225, 227, 231, 239, 240,
241, 243, 247, 248, 249, 251, 252, 253, 254 and 255.
• 255
• 127-1
• 63-1
• 31-1
• 15-1
• 7-1
• 3-1
• 1-1
• Binary output : 11111111 : no transition
• Uniform pattern
Examples of texture primitives which can be detected by
LBP (white circles represent ones and black cirlces zeros).

You might also like