无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網(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代碼的評論 (共 條)

分享到微博請遵守國家法律
吕梁市| 海南省| 平山县| 桐庐县| 清新县| 杭州市| 即墨市| 南京市| 永寿县| 张家界市| 水城县| 凤城市| 大姚县| 阜宁县| 德保县| 新建县| 通州区| 巴彦县| 拉萨市| 湖南省| 平顶山市| 陆河县| 辉县市| 景洪市| 香河县| 资溪县| 米脂县| 永顺县| 沁源县| 三都| 全州县| 南充市| 西乌珠穆沁旗| 麦盖提县| 万载县| 江西省| 庄河市| 陇西县| 呼玛县| 呈贡县| 丹江口市|