i have seen in some papers and in matlab also that LBP features extraction technique producing 59 features for 8 niegbours pixels for all size of images, that may be 128x128,256x256 and so on. Now i need to know how 59 features are generated in LBP?
The basic ideia in LBP is compare a central pixel with its neighbours and assign a binary value (0 or 1) if the central pixel has higher intensity or not than each neighbor. There are a lot of variations in defining how the binary values are assigned. In the classical mode, LBP code is not rotation invariant. But it may be turned rotation invariant by codifying the transitios from 1 to 0 or from 0 to 1.
If you used the first LPB code propose by Ojala et al. the way of counting codes is 2^P , where P is the number of neighbors. But for rotation invariant LBP the number of different codes may be P+1. P for for the number of possible transitions between 1 and 0 and 1 for grouping all the other possibilities.
@Eanes Pereira, thanks sir, for your valuable suggestion. i have another simple doubt regarding the LBP features. i have took 16x16 grayimage and applied mask as 3x3 and to test the method i have gone through row wise. as per its basic method i made comparing also as mentioned in the paper. sir i need to know how this method producing same number of features for different kinds of images. like 16x16,128x128,256x256,512x512 and 1024x1024. as i have observed for all this sized images same 59 featurs it is giving with the parameter as 8 neighbors.
sir can u explain me how 59 features will generated using LBP method??
Hi @Satish. Majority of LBP methods, after computing LBP codes compute histograms. That is the cause of all resolutions give always the same quantity of features. Which is the associated paper that you are implementing? It does not make sense to me 59 features.
Those 59 are the uniform patterns that are possible for the combinations of all 0s, single 1 (in an 8-bit pattern), 2 1's (in an 8-bit pattern) .... and so on up to 7 1's.
The 8 1's and all 0's are treated as 2 patterns, the rest 7 x 8 (rotated versions) gives 56 patterns. Apart from this, all the non-uniform patterns are treated as one pattern.
Hence, 59 patterns. Some works will consider 58 patterns neglecting non-uniform pattern.
Refer the attachment. or Google uniform patterns LBP.
The way Suresh explained is correct, but it is different from that orinally proposed by Timo Ojala . In the original version, LBPRI counts the transitions from 0 to 1 and vice-versa, and not the sequences of 0's and 1's.
@ Eanes Pereira, Sir after thresholding of the original image's values that is after comparison with center pixel values, the binary pattern created and in that the transitions are observed (i.e, 0 to 1, and 1 to 0) right sir??
The calculation of uniform LBP features is well explained in the original paper by Ahonen et al: "Face Description with Local Binary Patterns: Application to Face Recognition".
Note that we have realized that the Matlab implementation of LBP's is buggy, especially when it comes to round LBP features (i.e., LBP's are extracted using a circle around the center point).