?? ksw.asv
字號:
function y=ksw(t,mingrayvalue,maxgrayvalue,hist1,HT)
%計算最佳直方圖熵(KSW熵)
Pt=0;
for i=mingrayvalue:t
Pt=Pt+hist1(i+1);
end
Ht=0;
for i=mingrayvalue:t
if hist1(i+1)==0
temp=0;
else
temp=-hist1(i+1)*log(hist1(i+1));
end
Ht=Ht+temp;
end
if Pt==0 | Pt==1 % or(Pt==0,Pt==1)
H=0;
else
H=log(Pt*(1-Pt))+Ht/Pt+(HT-Ht)/(1-Pt);
end
y=H;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -