LBP, texture

advertisement
LBP & More
Slides from Dr. Shahera Hossain
Pixel Neighborhood-based Feature
• The most important for texture analysis is to describe
the spatial behavior of intensity values in any given
neighborhood.
• Different methodologies have been proposed.
• Local binary pattern (LBP) is one of the most-widely
used approach – mainly for face recognition.
• LBP is used for texture analysis too.
Local Binary Pattern (LBP)
For each PIXEL of an image, a BINARY CODE is produced
οƒ  to make a new matrix with the new value (binary to
decimal value).
𝑃−1
𝑔 𝑁𝑝 − 𝑁𝑐 2𝑝
𝐿𝐡𝑃𝑝,π‘Ÿ 𝑁𝑐 =
𝑝=0
where,
neighborhood pixels 𝑁𝑝 in each block οƒ 
is thresholdedby its center pixel value 𝑁𝑐
pοƒ  sampling points (e.g., p = 0, 1, …, 7 for a 3x3 cell, where P = 8)
r οƒ  radius (for 3x3 cell, it is 1).
Binary threshold function 𝑔 π‘₯ is,
0,
π‘₯<0
𝑔 π‘₯ =
1,
π‘₯≥0
Computation of Local Binary Pattern
Binary code for > Nc
3
7 2
8
4 1
2
3 5
0
1
0
1
Nc
0
0
0
1
Component-wise
multiplication
0
2
0
128
?
0
0
0
16
∑
Sum
LBP
146
Representation
Neighborhood
of a gray-scale
image
1
2
4
128
8
64
32 16
Example of how the LBP operator works
top
Computation of LBP
(LSB)
0
Binary Pattern:
1
(MSB)
Code/Weight 2𝑝 :
1 x 27 1 x 26 1 x 25 1 x 24 0 x 23
= 128
LBP:
1
= 64
1
= 32
1
= 16
0
0
1
(LSB)
0x 22
0x 21
1 x 20
=0
=0
=1
0
=0
1 + 0 + 0 + 0 + 16 + 32 + 64 + 128 = 241
A New Method: DCLBP
• A new method called diagonal-crisscross local binary pattern
(DCLBP) for texture representation is proposed recently.
• Basic concept: An image feature should take diagonal pixel
variations as well as horizontal and vertical (crisscross) pixel
variations in the neighborhood, so that it can perform well
even in the cases of rotations in images.
• Two other variants of the LBP, considering rotational feature
& mean/median of the neighbor pixels are also proposed
• These are compared with LBP, median-LBP, interpolationLBP, number-LBP, neighborhood-intensity-LBP.
Diagonal-Crisscross Local Binary Pattern
(DCLBP)
(a)
N1 – N5
N0 – N4
(b)
N2 – N6
(LSB)
N3 – N7
(c)
(d)
top
Diagonal-Crisscross Local Binary Pattern (DCLBP)…
a) 3x3 image patch
b) Start from N0 pixel position
c) Get differences for front-diagonal values (N0 – N4), in vertical
direction (N1 – N5), for back-diagonal direction (N2 – N6), and
in horizontal direction (N3 – N7)
1
1
3
5
7
d) Multiply each difference with 2 , 2 , 2 and 2 sequentially to 35
7
compute a new value
e) Take the mean value of newly-computed value and the central
pixel value
Diagonal-Crisscross Local Binary Pattern…
𝐷𝐢𝐿𝐡𝑃𝑝,π‘Ÿ 𝑁𝑐 =
𝑃 −1
π‘˜=0 πœ—
π›Ώπ‘˜,|𝑃|+π‘˜ × 2π‘π‘˜ ∈𝑃 + 𝑁𝑐
2
where,
Sampling-point set is, 𝑃 = 1, 3, 5, 7
Cardinality of the set is, 𝑃 = 4
Difference parameter 𝛿 is,
π›Ώπ‘˜,|𝑃|+π‘˜ = π‘π‘˜ − 𝑁|𝑃|+π‘˜
The binary threshold function πœ— 𝛿 is,
0,
𝛿<0
πœ— 𝛿 =
1,
𝛿≥0
p0 = 21
p1 = 23
p2 = 25
p3 = 27
Diagonal-Crisscross Local Binary Pattern…
Here, the cardinality, 𝑃 = 4 that demonstrates that it has 4 differentpossible values as ‘21, 23, 25 and 27’.
when π‘˜ = 0, we get
𝛿0,4+0 × 21 = 𝛿0,4 × 21
which, covers the front-diagonal difference of 𝑁0 − 𝑁4 .
Similarly,
when π‘˜ = 1, 𝛿1,5 × 23
covers the vertical difference of 𝑁1 − 𝑁5 ;
when π‘˜ = 2, 𝛿2,6 × 25
covers the back-diagonal difference of 𝑁2 − 𝑁6 ;
when π‘˜ = 3, 𝛿3,7 × 27
covers the horizontal difference of 𝑁3 − 𝑁7 .
Through this manner, we get the new central pixel value for each patch.
Median-RILBP
∝
𝐿𝐡𝑃𝑝,π‘Ÿ
𝑁𝑝 = π‘šπ‘’π‘‘π‘–π‘Žπ‘› 𝜌 𝐿𝐡𝑃𝑝,π‘Ÿ 𝑁𝑝 , 𝑖 |𝑝=0,1,…,𝑃−1
where,
• ∝ symbolizes ‘rotational-invariant’ nature;
• 𝑝 is pattern (e.g., 8 for a 3x3 patch);
• π‘Ÿ is radius (1 for 3x3 patch);
• Rho (𝜌
) is the rotational function where it circularly does bitwise
right-shift operation.
• 𝑖 is 8 when if 𝑃 = 8. so 8 times rotation
• The bit-shift is done 8 times if 𝑃 = 8. The concept here is to rotate the
𝑃neighbors.
• Finally, compute the π‘šπ‘’π‘‘π‘–π‘Žπ‘› value that the neighbor chain may
represent.
Mean-RILBP
∝
𝐿𝐡𝑃𝑝,π‘Ÿ
𝑁𝑝 = π‘šπ‘’π‘Žπ‘› 𝜌 𝐿𝐡𝑃𝑝,π‘Ÿ 𝑁𝑝 , 𝑖 |𝑝=0,1,…,𝑃−1
where,
• ∝ symbolizes ‘rotational-invariant’ nature;
• 𝑝 is pattern (e.g., 8 for a 3x3 patch);
• π‘Ÿ is radius (1 for 3x3 patch);
• Rho (𝜌
) is the rotational function where it circularly does
bitwise right-shift operation.
• 𝑖 is 8 when if 𝑃 = 8. so 8 times rotation
• The bit-shift is done 8 times if 𝑃 = 8. The concept here is to rotate
the 𝑃 neighbors.
• Finally, compute the MEAN value.
Experiment: Dataset 1
Figure: Sample images for each class of USC-SIPI Rotated Textures dataset.
Figure: Seven rotated images for bark class (USC-SIPI Rotated Textures dataset).
Experiment: Dataset 1 – USC-SIPI DB
• USC-SIPI (i.e., University of Southern California – Signal and Image
Processing Institute)) Rotated Textures dataset
• Each image is digitized at seven different rotation angles: 0, 30, 60, 90, 120,
150, and 200 degree for each of the 13 different images
• These images are taken from the Brodatz database which is the most widelyused dataset
USC-SIPI Database
Total classes
13
No. of images per class
7
Rotations
7
Image size
512x512 pixels
Total images
91
Experiment: Dataset 2
Ten different classes for KTH-TIPS dataset
(sandpaper, crumpled aluminum foil, styrofoam, sponge, corduroy,
linen, cotton, brown bread, orange peel and cracker B)
Experiment: Dataset 2 – KTH-TIPS Database
• KTH-TIPS (TIPS stands for ‘Textures under varying
Illumination, Pose and Scale’) database.
KTH-TIPS Database
Total classes
10
No. of images per class
81
Rotations & variations
81
Image size
200x200 pixels
Total images
810
Classification
• Lets employ
– K-nearest neighbor classifier (KNN) &
– Multi-class support vector machine (SVM) (radial
basis kernel function, gamma = 1). We consider
10-fold cross-validation
Recognition Results – 1
USC-SIPI Database
Total classes
13
No. of images
per class
7
Rotations
7
Image size
512x512
Total images
91
USC-SIPI Rotated Textures DB
Feature
KNN
SVM
LBP
46.0
74.7
Interpolation_LBP
46.1
80.2
Median_LBP
30.8
80.2
MedianR_LBP
84.6
93.4
Number_LBP
92.3
87.9
NI_LBP
23.1
65.9
Mean-RILBP
100
95.6
Median-RILBP
92.3
96.7
DCLBP
100
90.1
Recognition Results – 2
KTH-TIPS Database
Total classes
10
No. of
images per
class
81
Rotations &
variations
81
Image size
200x200
Total
images
810
Feature
LBP
KTH-TIPS DB
KNN
80
Interpolation_LBP
Median_LBP
MedianR_LBP
Number_LBP
NI_LBP
Mean-RILBP
Median-RILBP
DCLBP
60
70
70
90
70
70
70
90
SVM
53.7
53.1
46.4
28
35.2
55.7
23.4
29.6
72.5
top
Thank you very much for your kind attention
Download