フィルターのクリア

is this the right code ?

5 ビュー (過去 30 日間)
azkya novia
azkya novia 2017 年 9 月 5 日
コメント済み: azkya novia 2017 年 9 月 7 日
i'm trying to get features from my thinned of finger vein images by using lbp. i found this code, is this right code to extract features lbp from my images ?
I2 = imread(thisismythinnedimage);
figure, imshow(I2)%
w=size(I2,1);
h=size(I2,2);
%%LBP
for i=2:w-1
for j=2:h-1
J0=I2(i,j);
I3(i-1,j-1)=I2(i-1,j-1)>J0;
I3(i-1,j)=I2(i-1,j)>J0;
I3(i-1,j+1)=I2(i-1,j+1)>J0;
I3(i,j+1)=I2(i,j+1)>J0;
I3(i+1,j+1)=I2(i+1,j+1)>J0;
I3(i+1,j)=I2(i+1,j)>J0;
I3(i+1,j-1)=I2(i+1,j-1)>J0;
I3(i,j-1)=I2(i,j-1)>J0;
LBP(i,j)=I3(i-1,j-1)*2^8+I3(i-1,j)*2^7+I3(i-1,j+1)*2^6+I3(i,j+1)*2^5+I3(i+1,j+1)*2^4+I3(i+1,j)*2^3+I3(i+1,j-1)*2^2+I3(i,j-1)*2^1;
end
end
figure,imshow(I3)
figure,imhist(LBP)
i have tried this code but not understand enough how the codes works to get lbp from my images i intended to get bins of lbp for classification. from this code i cannot get decimal value of bins .
  2 件のコメント
Stephen23
Stephen23 2017 年 9 月 5 日
@azkya novia: today I formatted your code correctly for you. In future you can do it yourself: first select the code text, then click the {} Code button.
azkya novia
azkya novia 2017 年 9 月 5 日
i did it, i asked and put my code in the code button. i dont know if the code changed appeare to be unformated

サインインしてコメントする。

採用された回答

Image Analyst
Image Analyst 2017 年 9 月 5 日
If it does what you want and expect, then it's the right code for you, though there is no need for I3 to be a 2-D array, and the program is lacking in comments.
As an alternative, I attach my LBP demo program.
  1 件のコメント
azkya novia
azkya novia 2017 年 9 月 7 日
I just saw this answer. thank you ImageAnalyst :)

サインインしてコメントする。

その他の回答 (1 件)

Guillaume
Guillaume 2017 年 9 月 5 日
編集済み: Guillaume 2017 年 9 月 5 日
The code may or may not be correct. I've not wasted the time checking every single line is correct as it's so horribly written. I suggest you do a search on the FileExchange for some better code.
An example of how bad the code is: you can replace all the I3(.., ..) = ... lines by just this one line:
I3(i-1:i+1, j-1:j+1) = I2(i-1:i+1, j-1:j+1) > J0;
There are a lot more problems with it (I3 gets resized at each step of the loop, the loop is not even needed, no vectorisation of the LBP computation, etc.). As said, find a better implementation.
  1 件のコメント
azkya novia
azkya novia 2017 年 9 月 5 日
Ok thank you for the answer :)

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by