Local binary pattern (LBP) is a very important feature in the field of machine vision. LBP can effectively handle illumination changes and is widely used in texture analysis and texture recognition.
The LBP algorithm is very simple, simply speaking, is to compare the grayscale value of a pixel in the image with the gray value of the pixel in its neighborhood, as shown in:
If the neighborhood pixel value is larger than that point, then it is assigned to 1, and vice versa, then it is assigned 0, so from the upper left corner, you can form a bit chain and then convert the bit chain to a decimal number, which can be expressed as follows:
LB< Span class= "Mi" id= "mathjax-span-44165" style= "Font-family:mathjax_math; Font-style:italic; " >p P,R ( x c , y c )= ∑ < Span class= "Texatom" id= "mathjax-span-44187" >p = 0 P? 1 s( i p ? i c ) 2P
which s Represents a threshold function that satisfies the following relationship:
s(x)=1,x≥0 ,
s(x)=0,x<0
With this conversion, a pixel is represented by a number in the difference relationship of the neighborhood, because LBP records the difference between pixel points and neighborhood pixels, so the same increase in pixel values caused by illumination changes does not change the size of LBP, especially in local areas, We can think that the change of pixel value caused by illumination to image is unidirectional, so LBP can save the difference relation of pixel value in image well. LBP can be further analyzed by histogram, which can be used as a feature operator for texture analysis.
We can see that R Represents the radius of the neighborhood, p Span style= "Display:inline-block; width:0px; Height:2.279em; " > Indicates the number of neighboring pixels, or the length of bit chain, if the radius of the neighborhood is 1, the number of pixels in the neighborhood is 8, the bit chain is 8, if the neighborhood radius is 2, the number of pixels in the neighborhood is 16,bit chain length is 16, the neighborhood radius is 3, The number of pixels in the neighborhood is 24,bit chain length of 24, as shown in:
Let's consider the simplest R=1,P=8 , LBP maps a value between 0-255 and, if represented by a histogram, requires a 256-dimensional array to store the histogram. In order to reduce the storage space, someone proposed uniform pattern encoding method, according to a bit chain 0, 1 between the number of conversions defined uniform pattern. If the number of conversions between 0 and 1 in a bit chain is no more than two times, then this bit chain is uniform pattern, for example, 00000000 conversions are 0, 00001111 conversions are 1, 00011100 conversions are 2, 01101100 conversions of 4, 01101010 conversions of 6, those who convert not more than two times the pattern is uniform pattern, it can be proved that the vast majority of binary pattern is uniform pattern, With this definition, the 8-bit LBP can be reduced from 256 to 59-D, reducing 90%.
LBP code can be downloaded on the following Web site:
Http://www.cse.oulu.fi/CMV/Downloads/LBPMatlab
Reference documents
[1] D. Huang, C. Shan, M. Ardabilian, Y Wang, and L. Chen, "Local Binary Patterns and its application to facial Image Ana Lysis A Survey, "Systems, Man, and Cybernetics, part c:applications and reviews, IEEE Transactions on, vol, pp. 765-9 81, 2011.
[2] T. Ojala, M. Pietikainen, and T. Maenpaa, "Multiresolution gray-scale and rotation invariant texture classification WI Th local binary patterns, "Pattern analysis and Machine Intelligence, IEEE Transactions On, vol, pp. 971-987, 2002.
Machine Vision Local Binary Pattern (LBP)