 function e=entropy2(p);
 [m,n]=size(p);
 p2=p(5:124,5:124);
 p=0;
 p=p2;
[m,n]=size(p);
W=128;
p=double(p);
p = imfilter(p, fspecial('gaussian',100, (W*0.02)));
p=mat2gray(p);
p=p*63;
p=uint8(p);
q=p;
bin=zeros(64,64);
for i=1:m
    for j=1:n
        bin(p(i,j)+1,q(i,j)+1)=bin(p(i,j)+1,q(i,j)+1)+1;
    end
end
bin=bin/(m*n);
bin1=-bin;
bin2=log(bin+double(bin==0));
bin3=bin1.*bin2;
e=sum(bin3(:));

       