資源簡(jiǎn)介
用單閾值三種方法實(shí)現(xiàn)肺野分割的Matlab程序
代碼片段和文件信息
function?I_gray?=?Kapur(I_gray)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I_gray=double(I_gray);???????%轉(zhuǎn)化為雙精度
[widthheight]=size(I_gray);
graylevel=256;???????????????%灰度級(jí)
hist=zeros(1graylevel);?????%直方圖賦初值
?
%計(jì)算直方圖
for?i=1:width
????for?j=1:height
????????m=I_gray(ij)+1;
????????hist(m)=hist(m)+1;
????end
end
p=zeros(1graylevel);
for?i=1:1:graylevel
????p(i)=hist(i)/(width*height);?%直方圖歸一化
end
E1=zeros(1graylevel);
E2=zeros(1graylevel);
P=zeros(1graylevel);
E=zeros(1graylevel);
for?t=1:1:graylevel
????for?i=1:1:t
????????P(t)=P(t)+p(i);
????end
????????if(P(t)>0&&P(t)<1)
%???????????????Q=0;
??????????%計(jì)算灰度范圍為[1t]的熵
???????????for?i=1:1:t
???????????????E1(t)=E1(t)-(p(i)/P(t))*log(p(i)/P(t)+eps);
???????????end
%????????????A(s)=2*log(P(s
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件?????238704??2010-01-07?12:09??lungSegmentation\images\2.PNG
?????文件?????207951??2010-01-05?19:48??lungSegmentation\images\3.png
????..A.SH.?????46592??2010-01-07?13:51??lungSegmentation\images\Thumbs.db
?????文件???????1579??2010-01-06?21:30??lungSegmentation\Kapur.m
?????文件???????1410??2010-01-07?11:00??lungSegmentation\kittler.m
?????文件????????554??2010-01-13?10:33??lungSegmentation\LungSegmentation_demo.m
?????文件???????1456??2010-01-06?21:20??lungSegmentation\ostu.m
?????目錄??????????0??2010-01-13?10:33??lungSegmentation\images
?????目錄??????????0??2010-01-13?10:30??lungSegmentation
-----------?---------??----------?-----??----
???????????????498246????????????????????9
評(píng)論
共有 條評(píng)論