I just want to implement Local Binary Pattern over ORL database but how can i access ORL database to apply my program over the database

1 次查看(过去 30 天)
i have implemented the Local binary pattern for a single image using the code below:
clear all;
close all;
clc;
I=imread('s.jpg');
figure,imshow(I)
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^7+I3(i-1,j)*2^6+I3(i-1,j+1)*2^5+I3(i,j+1)*2^4+I3(i+1,j+1)*2^3+I3(i+1,j)*2^2+I3(i+1,j-1)*2^1+I3(i,j-1)*2^0;
end
end
subplot(1,2,1);
imshow(LBP,[]);
subplot(1,2,2);
[pixel,y] = imhist(uint8(LBP));
bar(y,pixel);
Now i want apply the same algorithm for ORL Database how cam implement the same code for ORL database

回答(1 个)

ajith
ajith 2012-11-21

Community Treasure Hunt

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

Start Hunting!

Translated by