【圖像分割】基于局部信息的模糊C均值聚類算法(FLICM)實現(xiàn)圖像分割matlab代碼
【圖像分割】基于局部信息的模糊C均值聚類算法(FLICM)實現(xiàn)圖像分割matlab代碼
1 簡介
以圖像分割為研究內(nèi)容,分析了圖像的空頻域特征,并在此基礎(chǔ)之上提出了一種基于模糊局部信息C均值聚類的分割算法.由于FLICM算法充分利用局部空間信息和局部灰度信息,能夠很好地描述模糊性,對于邊界不清晰的太赫茲圖像有很好地效果.采用不同成像條件下的多類太赫茲圖像進行實驗,結(jié)果表明此方法能夠很好地克服邊緣模糊,隨機噪聲,條紋噪聲等干擾,分割所得目標(biāo)輪廓完整,準(zhǔn)確,有較高的精度,為進一步的圖像目標(biāo)識別打下了良好的基礎(chǔ).
2 部分代碼
clear ; clc ; data = randn ( 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’ ); I = rgb2gray ( I ); figure , imshow ( I ,[]); title ( ’原圖’ ); g = imnoise ( I , ’salt & pepper’ , 0.02 ); % 給圖像添加高斯噪聲 figure , imshow ( g ,[]); title ( ’添加高斯噪聲后的圖像’ ); g = double ( g ); [ m , n ] = size ( g ); k = 2 ; % ---------fcm---------------- fcm_label = zeros ( m * n , 1 ); [ O , U , obj_fcn1 ] = fcm ( g (:), k ); maxU = max ( U ); for j = 1 : k index = find ( U ( j , :) == maxU ); fcm_label ( index ) = j ; end fcm_result = reshape ( fcm_label ,[ m n ]); figure , imshow ( fcm_result ,[]); title ( ’fcm分割結(jié)果’ ); % ------------------------ FLICM法------------------------ r = 3 ; % 求G時,鄰域窗的大小 [ neighbor_pos , window_d ]= FLICM_find_neighbor ( g , r ); FLICM_label = zeros ( m * n , 1 ); t = cputime ; X = g (:); [ O10 , U10 , obj_fcn10 ] = FLICM ( X , k , neighbor_pos , window_d ); time_FLICM = cputime - t ; maxU10 = max ( U10 ); for j = 1 : k index = find ( U10 ( j , :) == maxU10 ); FLICM_label ( index ) = j ; end labels10 = reshape ( FLICM_label ,[ m n ]); figure , imshow ( labels10 ,[]); title ( ’flicm分割結(jié)果’ );
3 仿真結(jié)果
4 參考文獻
[1]雷萌, 黃志堅, and 馬芳粼. "一種基于局部信息模糊聚類的太赫茲圖像分割算法." 制造業(yè)自動化 37.12(2015):3.
部分理論引用網(wǎng)絡(luò)文獻,若有侵權(quán)聯(lián)系博主刪除。
微信掃一掃贊賞作者
贊賞
發(fā)送給作者
人贊賞
長按二維碼向我轉(zhuǎn)賬
受蘋果公司新規(guī)定影響,微信 iOS 版的贊賞功能被關(guān)閉,可通過二維碼轉(zhuǎn)賬支持公眾號。
-
Origin(Pro):學(xué)習(xí)版的窗口限制【數(shù)據(jù)繪圖】 2020-08-07
-
如何卸載Aspen Plus并再重新安裝,這篇文章告訴你! 2020-05-29
-
CAD視口的邊框線看不到也選不中是怎么回事,怎么解決? 2020-06-04
-
教程 | Origin從DSC計算焓和比熱容 2020-08-31
-
Aspen Plus安裝過程中RMS License證書安裝失敗的解決方法,親測有效! 2021-10-15
-
CAD外部參照無法綁定怎么辦? 2020-06-03
-
CAD中如何將布局連帶視口中的內(nèi)容復(fù)制到另一張圖中? 2020-07-03
