【图像分割】基于空间信息的模糊均值聚类算法实现图像分割matlab代码

225 阅读1分钟

1 简介

针对传统的模糊C-均值(FCM)算法没有考虑图像像素的空间邻域信息,对噪声敏感,算法收敛较慢等问题,该文提出一种抑制式非局部空间直觉模糊C-均值图像分割算法。首先,通过计算像素的非局部空间信息提高抗噪能力,克服传统的FCM算法只考虑图像单个像素的灰度特征信息的缺陷,提高分割精度。其次,根据直觉模糊集理论,通过“投票模型”自适应生成犹豫度作为抑制因子修正隶属度,提高算法的运行效率。实验结果表明,该算法对噪声鲁棒性较强并且有较好的分割性能。

2 部分代码

function runtest(opt)
% Run examples in the reference:
%   B.N. Li, C.K. Chui, S. Chang, S.H. Ong (2011) Integrating spatial fuzzy
%   clustering with level set methods for automated medical image
%   segmentation. Computers in Biology and Medicine 41(1) 1-10.
%--------------------------------------------------------------------------

if opt==1
   img=imread('ctlivertumor.bmp');
   ncluster=3;
elseif opt==2
   img=imread('mrihead.bmp');
   ncluster=4;
else
   error('Invalid opt: 1 or 2 only!')
end

MF = SFCM2D(img,ncluster);

figure
subplot(231); imshow(img,[])
for i=1:ncluster
   imgfi=reshape(MF(i,:,:),size(img,1),size(img,2));
   subplot(2,3,i+1); imshow(imgfi,[])
   title(['Index No: ' int2str(i)])
end

temp=1;
while temp
   nopt = input('Input the Index No that you are interested\n');
   if ~isempty(nopt), temp=0; end
end

close(gcf);

imgfcm=reshape(MF(nopt,:,:),size(img,1),size(img,2));

fuzzyLSM(img,imgfcm,.5);

3 仿真结果

4 参考文献

[1]段青竹. 基于模糊集与空间信息的图像分割算法研究[D]. 中北大学.​

部分理论引用网络文献,若有侵权联系博主删除。

5 MATLAB代码与数据下载地址

见博客主页