拓冰建站拓冰建站
首页 / 资讯中心 / 正文

【图像分割】基于局部信息的模糊C均值聚类算法(FLICM)实现图像分割matlab代码

1 简介以图像分割为研究内容,分析了图像的空频域特征,并在此基础之上提出了一种基于模糊局部信息C均值聚类的分割算法.由于FLICM算法充分利用局部空间信息和局部灰度信息,能够很好地描述模糊性,对于边界不清晰的太赫兹图像有很好地效果.采用不同成像条件下的多类太赫兹图像进行实验,结果表明此方法能够很好地克服边缘模糊,随机噪声,条纹噪声等干扰,分割所得目标轮廓完整,准确,有较高的精度,为进一步的图像目标识别打下了良好的基础.2 部分代码clear; clc; datarandn(310,2); [center,U,obj_fcn] fcm(data,2); plot(data(:,1), data(:,2),o); hold on; maxU max(U); % Find the data points with highest grade of membership in cluster 1 index1 find(U(1,:) maxU); % Find the data points with highest grade of membership in cluster 2 index2 find(U(2,:) maxU); %line(data(index1,1),data(index1,2),marker,*,color,g); %line(data(index2,1),data(index2,2),marker,*,color,r); % Plot the cluster centers plot([center([1 2],1)],[center([1 2],2)],*,color,k); hold off; % I imread(lena.jpg); %I imread(eight.tif); % I imread(romantic.jpg); I imread(bacteria.jpg); Irgb2gray(I); figure,imshow(I,[]); title(原图); gimnoise(I,salt pepper,0.02); % 给图像添加高斯噪声 figure,imshow(g,[]); title(添加高斯噪声后的图像); g double(g); [m,n] size(g); k2; % ---------fcm---------------- fcm_labelzeros(m*n,1); [O,U,obj_fcn1] fcm(g(:), k); maxU max(U); for j1:k index find(U(j, :) maxU); fcm_label(index) j; end fcm_resultreshape(fcm_label,[m n]); figure, imshow(fcm_result,[]); title(fcm分割结果); % ------------------------ FLICM法------------------------ r 3; % 求G时邻域窗的大小 [neighbor_pos,window_d]FLICM_find_neighbor(g,r); FLICM_labelzeros(m*n,1); tcputime; X g(:); [O10,U10,obj_fcn10] FLICM(X,k,neighbor_pos,window_d); time_FLICMcputime-t; maxU10 max(U10); for j1:k index find(U10(j, :) maxU10); FLICM_label(index) j; end labels10reshape(FLICM_label,[m n]); figure, imshow(labels10,[]); title(flicm分割结果);3 仿真结果4 参考文献[1]雷萌, 黄志坚, and 马芳粼. 一种基于局部信息模糊聚类的太赫兹图像分割算法. 制造业自动化 37.12(2015):3.部分理论引用网络文献若有侵权联系博主删除。
分享:

看完干货,该让你的企业上线了

免费需求沟通 · 48 小时内出具建站方案 · 河南本地可上门