functionmi=MI(a,b)%CaculateMIofaandbintheregionoftheoverlappart%计算重叠部分[Ma,Na]=size(a);[Mb,Nb]=size(b);M=min(Ma,Mb);N=min(Na,Nb);%初始化直方图数组hab=zeros(256,256);ha=zeros(1,256);hb=zeros(1,256);%归一化ifmax(max(a))~=min(min(a))a=(a-min(min(a)))/(max(max(a))-min(min(a)));elsea=zeros(M,N)