Thank you for the code. It really helped. I would really appreciate if your or anyone else can help me with this please.
Image texture analysis: extractLBPfeatures MATLAB function
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I implemented the localBinaryPattern code. Thanks to @Image Analyst, I was able to understand how they were derived.
Now, I am trying to understand the extractLBPfeatures function in MATLAB. It is troubling me a lot. This function produces a feature vector of size '1 by 59 single '. I understood, why the size is 59 but I am not able to understand how they were derived and how the LBP values turned into decimal values. Somewhere I read histogram normalized. But how exactly? Can anyone help me please.
The code is attached with a few extra lines to show where I am having trouble.
Antworten (1)
Udit06
am 7 Sep. 2023
Hi Towfeeq,
I understand that you want to know how the LBP features are extracted and how they are converted to decimal values. Consider the following figure:
![A 3*3 matrix for LBP illustration](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1475421/A%203*3%20matrix%20for%20LBP%20illustration.png)
To find the LBP feature value corresponding to any centre pixel, you compare the centre pixel value with the value of its 8 neighbours. If the intensity of the centre pixel is less than or equal to its neighbour, we set the value to 1, otherwise we set it to 0.
Hence, for the above figure we do the following:
(82>68=1)(57>68=0)(90>68=1)(53>68=0)(92>68=1)(56>68=0)(99>68=1)(78>68=1)
Thus, the LBP code obtained in binary: ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1475426/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1475426/image.png)
Once we obtain the binary code as shown above, we can simple apply binary to decimal conversion to get the decimal value.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1475431/image.png)
The decimal value obtained above work as a feature for the pixels in the patch and the frequencies of these features in a patch forms a histogram.
You can refer to the following research paper to understand more about Local binary pattern.
I hope this helps.
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!