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


function [ value] = dif_entropy( I1,I2 ) 
%DIF_ENTROPY 此处显示有关此函数的摘要 
%   偏差熵,越小说明融合图像与参考图像越接近,融合效果越好 
I1=rgb2gray(I1); 
[counts1,x]=imhist(I1); 
counts1=counts1/(size(I1,1)*size(I1,2)); 
I2=rgb2gray(I2); 
[counts2,x]=imhist(I2); 
counts2=counts2/(size(I2,1)*size(I2,2)); 
E=0; 
for i=0:255 
    if(counts1(i+1)~=0) 
       E=E+counts1(i+1)*log2(1-(counts1(i+1)-counts2(i+1)).^2); 
    end 
end 
value=E; 
end