www.pudn.com > duge.rar > entropy.m, change:2015-06-01,size:320b


function [ value ] = entropy( I ) 
%Ϣ 
%ENTROPY Summary of this function goes here 
%   Detailed explanation goes here 
 
I=rgb2gray(I); 
[counts,x]=imhist(I); 
counts=counts/(size(I,1)*size(I,2)); 
E=0; 
for i=0:255 
    if(counts(i+1)~=0) 
       E=E+counts(i+1)*log2(counts(i+1)); 
    end 
end 
value=-E; 
end