使用八度音阶迭代阈值分类

时间:2017-12-09 10:58:38

标签: matlab octave

我正在尝试设计无监督的分类器 使用迭代阈值算法用于肺组织和胸部 我正在尝试将像素分类为胸部和肺部类别,我不知道代码有什么问题

 x=imread("Ground_Truth_CT_001.bmp");
c=imread("CT_001.bmp");
y1=double(c(:,:,1));
lung_musk=nonzeros(y1.*double(x==255));
chest_musk=nonzeros(y1.*double(x==78));

 mean_b=mean(lung_musk)
mean_b =  53.177
 mean_n=mean(chest_musk)
mean_n =  166.03
t=(mean_b+mean_n)/2
t =  109.60              %approximately 110
Th=110;
   th0=0.5;
   Tnew=130;
     while ((Tnew - Th) < th0 )
      G1 = y1 > Th;
      G2 = y1 <= Th;

  mean1 = mean(y1(G1))
  mean2 = mean(y1(G2))
  Tnew=(1/2) * (mean1 +mean2)
  endwhile

0 个答案:

没有答案