最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

【圖像分割】基于哈里斯鷹優(yōu)化多閾值實現(xiàn)圖像分割附matlab代碼

2022-05-20 23:29 作者:Matlab工程師  | 我要投稿

1 簡介

一種基于哈里斯鷹優(yōu)化算法圖像分割方法,包括:步驟1:獲取待分割圖像的灰度值范圍;步驟2:根據(jù)所述圖像的灰度值范圍利用哈里斯鷹優(yōu)化算法得到待分割圖像的最佳閾值;步驟3:根據(jù)所述圖像分割的最佳閾值,對待分割圖像進(jìn)行分割.本發(fā)明是一種新的基于哈里斯鷹與S熵的圖像分割方法,相比于其他經(jīng)典優(yōu)化算法解決多閾值圖像分割的問題,具有分割圖像質(zhì)量更高和分割結(jié)果更為穩(wěn)定的優(yōu)點.

2 部分代碼

%% MCET-HHO%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% An Efficient Harris Hawks-inspired Image Segmentation Method%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%clear allclcclose all%% Initial dataI=imread('rice.png'); ? ?% Load image[h,nh]=imhist(I); ? ? ? ? ? % Get Histogram[m,n]=size(I); ? ? ? ? ? ? ?% Image sizeL=length(h); ? ? ? ? ? ? ? ?% Lmax levels to segment 0 - 256Nt=size(I,1) * size(I,2); ? % Total pixels in the image% Frequency distribution of each intensity level of the histogram 0 - 256for i=1:L ? ?probI(i)=h(i)/Nt;end%% Initial data of the HHO algorithmnVar=1; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? % Number of thresholds (Th)VarSize=[1 nVar]; ? ? ? ? ? ? ? ? ? ? ? % Decision Variables in MatrixVarMin=1; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? % Minimum value of ThVarMax=255; ? ? ? ? ? ? ? ? ? ? ? ? ? ? % Maximum value of Th%% Harris Hawks Algorithm ParametersN=30; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? % Maximum Number of HawksT=100; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?% Maximum Number of IterationsticRabbit_Location=zeros(1,nVar); ? ? ? ? ?% Initialization of the rabbit's locationRabbit_Energy=inf; ? ? ? ? ? ? ? ? ? ? ?% Initialization of the energy of the rabbit%% Initialization of the position of the hawksX=initialization(N,nVar,VarMax,VarMin);%% Harris Hawks Algorithm MainCNVG=zeros(1,T);t=0;????????????????????????????????????%?Counter ? ?CNVG(t)=Rabbit_Energy;end%% Image segmentationIth=MultiTresh(I,Rabbit_Location);figuresubplot(122)imshow(Ith);title('哈里斯鷹優(yōu)化閾值分割后的圖')subplot(121)imshow(I);title('原圖')%% Evaluation of the segmentation%PSNR: Peak Signal to Noise RatioPSNR=psnr(Ith, I)% SSIM: Structural Similarity Index (1, indica una conincidencia perfecta)SSIM=ssim(I,Ith)%FSIM: Feature Similarity IndexFSIM=FeatureSIM(I,Ith)%% Histogram Plotfitness = Rabbit_Energyintensity = Rabbit_Locationfigureplot(probI)hold onvmax = max(probI);for i = 1:length(Rabbit_Location) ? ?line([intensity(i), intensity(i)],[0 vmax],[1 1],'Color','r','Marker','.','LineStyle','-'); ? ?hold onendhold off

3 仿真結(jié)果

4 參考文獻(xiàn)

[1]張光斌, 王運, 趙程程,等. 一種基于哈里斯鷹優(yōu)化算法的圖像分割方法:, CN110827299A[P]. 2020.

博主簡介:擅長智能優(yōu)化算法、神經(jīng)網(wǎng)絡(luò)預(yù)測、信號處理、元胞自動機(jī)、圖像處理、路徑規(guī)劃、無人機(jī)等多種領(lǐng)域的Matlab仿真,相關(guān)matlab代碼問題可私信交流。

部分理論引用網(wǎng)絡(luò)文獻(xiàn),若有侵權(quán)聯(lián)系博主刪除。


【圖像分割】基于哈里斯鷹優(yōu)化多閾值實現(xiàn)圖像分割附matlab代碼的評論 (共 條)

分享到微博請遵守國家法律
镶黄旗| 景洪市| 乌拉特前旗| 弥渡县| 梁平县| 清河县| 长寿区| 安吉县| 马边| 共和县| 三明市| 华宁县| 彰武县| 泸水县| 丹凤县| 社会| 开鲁县| 社旗县| 桑日县| 榆社县| 扶余县| 清原| 长阳| 涞水县| 邵阳县| 登封市| 北海市| 天门市| 亳州市| 绥芬河市| 铁岭市| 新兴县| 桂林市| 绍兴县| 连城县| 乌鲁木齐县| 阳曲县| 绵竹市| 五原县| 娱乐| 卢龙县|