91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 4.9MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2023-10-11
  • 語言: Matlab
  • 標簽: 神經網絡??

資源簡介

深度學習,神經網絡,隨機優化,小波分析,圖像處理,

資源截圖

代碼片段和文件信息

%%%%%%%%%%%%%%%%遺傳算法在道路圖像閾值分割中的應用%%%%%%%%%%%%
function?main()
clear?all
close?all
clc
global?chrom?oldpop?fitness?lchrom??popsize?cross_rate?mutation_rate?thresholdsum
global?maxgen??m?n?fit?gen?threshold?A?B?C?oldpop1?popsize1?b?b1?fitness1?threshold1
A=imread(‘1.jpg‘);?????%讀入道路圖像
A=imresize(A0.5);?????%利用imresize函數通過默認的最近鄰插值將圖像放大0.5倍
B=rgb2gray(A);?????????%灰度化
C=imresize(B0.2);?????%將讀入的圖像縮小到0.2倍
lchrom=10;??????????????%染色體長度
popsize=10;????????????%種群大小
cross_rate=0.8;????????%交叉概率
mutation_rate=0.5;?????%變異概率
maxgen=100;????????????%最大代數
[mn]=size(C);
initpop;????%初始種群
for?gen=1:maxgen
????generation;??%遺傳操作
end
findthreshold_best;?%圖象分割結果
%%%%%%%%%%%%%%%%%%%輸出進化各曲線%%%%%%%%%%%
figure;
gen=1:maxgen;
plot(genfit(1gen));?
title(‘最佳適應度值進化曲線‘);
xlabel(‘代數‘)
ylabel(‘最佳適應度值‘)
figure;
plot(genthreshold(1gen));
title(‘每一代的最佳閾值變化曲線‘);
xlabel(‘代數‘)
ylabel(‘每一代的最佳閾值‘)
%%%%%%%%%%%%%%%%%%%初始化種群%%%%%%%%%%%%%%%%%%%%
function?initpop()
global?lchrom?oldpop?popsize?chrom?C
imshow(C);
for?i=1:popsize
????chrom=rand(1lchrom);
????for?j=1:lchrom
????????if?chrom(1j)<0.5
????????????chrom(1j)=0;
???????else?
???????????chrom(1j)=1;
????????end
????end
????oldpop(i1:lchrom)=chrom;????%給每一個個體分配8位的染色體編碼
end

%%%%%%%%%%%%%%%%%產生新一代個體%%%%%%%%%%%%%%%%%%%%%%
function?generation()
fitness_order;??????????????????%計算適應度值及排序
select;?????????????????????????%選擇操作
crossover;??????????????????????%交叉
mutation;???????????????????????%變異
%%%%%%%%%%%%%%%%%計算適度值并且排序%%%%%%%%%%%%%%%%%%%
function?fitness_order()
global?lchrom?oldpop?fitness?popsize?chrom?fit?gen?C?m?n??fitness1?thresholdsum
global?lowsum?higsum?u1?u2?threshold?gen?oldpop1?popsize1?b1?b?threshold1?
if?popsize>=5
????popsize=ceil(popsize-0.03*gen);
end
if?gen==75?????%當進化到末期的時候調整種群規模和交叉、變異概率
????cross_rate=0.3;????????%交叉概率
????mutation_rate=0.3;?????%變異概率
end
%如果不是第一代則將上一代操作后的種群根據此代的種群規模裝入此代種群中
if?gen>1???
????t=oldpop;
????j=popsize1;
????for?i=1:popsize
????????if?j>=1
????????????oldpop(i:)=t(j:);
????????end
????????j=j-1;
????end
end
%計算適度值并排序
for?i=1:popsize
????lowsum=0;
????higsum=0;
????lownum=0;
????hignum=0;
????chrom=oldpop(i:);
????c=0;
????for?j=1:lchrom
????????c=c+chrom(1j)*(2^(lchrom-j));
????end
????b(1i)=c*255/(2^lchrom-1);??%轉化到灰度值????????
????for?x=1:m
????????for?y=1:n
????????????if?C(xy)<=b(1i)
????????????????lowsum=lowsum+double(C(xy));%統計低于閾值的灰度值的總和
????????????????lownum=lownum+1;?%統計低于閾值的灰度值的像素的總個數
????????????else
????????????????higsum=higsum+double(C(xy));%統計高于閾值的灰度值的總和
????????????????hignum=hignum+1;?%統計高于閾值的灰度值的像素的總個數
????????????end
????????end
????end
????if?lownum~=0
????????u1=lowsum/lownum;?%u1、u2為對應于兩類的平均灰度值
????else
????????u1=0;
????end
????if?hignum~=0
????????u2=higsum/hignum;
????else
????????u2=0;
????end???
????fitness(1i)=lownum*hignum*(u1-u2)^2;?%計算適度值
end
if?gen==1?%如果為第一代,從小往大排序
????for?i=1:popsize
????????j=i+1;
????????while

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????53547??2014-04-26?08:36??Intelligent?algorithm\10\s10_1\1.jpg

?????文件???????8775??2014-04-26?09:03??Intelligent?algorithm\10\s10_1\s10_1.m

?????文件??????53547??2014-04-26?08:36??Intelligent?algorithm\10\s10_2\1.jpg

?????文件???????1634??2014-04-26?11:08??Intelligent?algorithm\10\s10_2\bys.m

?????文件?????575694??2014-04-26?10:11??Intelligent?algorithm\10\s10_3\1.bmp

?????文件??????33120??2014-04-26?10:37??Intelligent?algorithm\10\s10_3\a.BMP

?????文件????????309??2014-04-26?10:39??Intelligent?algorithm\10\s10_3\gabptrain.m

?????文件????????985??2014-04-26?10:41??Intelligent?algorithm\10\s10_3\gadecod.m

?????文件????????186??2014-04-26?10:03??Intelligent?algorithm\10\s10_3\gafitness.m

?????文件????????191??2014-04-26?10:39??Intelligent?algorithm\10\s10_3\generatesample.m

?????文件????????615??2014-04-26?10:03??Intelligent?algorithm\10\s10_3\getWBbyga.m

?????文件????????445??2014-04-26?10:45??Intelligent?algorithm\10\s10_3\initnet.m

?????文件????????778??2014-04-26?10:54??Intelligent?algorithm\10\s10_3\main.m

?????文件???????2424??2014-04-26?10:06??Intelligent?algorithm\10\s10_3\net.mat

?????文件???????2424??2014-04-26?10:06??Intelligent?algorithm\10\s10_3\net1.mat

?????文件????????270??2014-04-26?10:46??Intelligent?algorithm\10\s10_3\nninit.m

?????文件????????496??2018-11-16?16:17??Intelligent?algorithm\10\s10_3\sample.mat

?????文件????????306??2014-04-26?10:41??Intelligent?algorithm\10\s10_3\segment.m

?????文件????????712??2014-04-25?19:35??Intelligent?algorithm\10\s10_4\cross_2d.m

?????文件????????816??2014-04-26?14:10??Intelligent?algorithm\10\s10_4\cross_2d_improve.m

?????文件????????474??2014-04-26?13:00??Intelligent?algorithm\10\s10_4\cross_ga.m

?????文件????????579??2014-04-26?12:55??Intelligent?algorithm\10\s10_4\cross_ga_improve.m

?????文件?????343854??2014-04-26?14:22??Intelligent?algorithm\10\s10_4\Hepburn.bmp

?????文件????????614??2014-04-25?19:35??Intelligent?algorithm\10\s10_4\ksw.m

?????文件????????761??2014-04-25?19:35??Intelligent?algorithm\10\s10_4\ksw_2d.m

?????文件???????2560??2014-04-26?15:21??Intelligent?algorithm\10\s10_4\ksw_2d_ga.m

?????文件???????2563??2014-04-26?15:21??Intelligent?algorithm\10\s10_4\ksw_2d_ga_improve.m

?????文件???????1772??2014-04-26?15:21??Intelligent?algorithm\10\s10_4\ksw_ga.m

?????文件???????1820??2014-04-26?15:21??Intelligent?algorithm\10\s10_4\ksw_ga_improve.m

?????文件??????66614??2014-04-25?19:35??Intelligent?algorithm\10\s10_4\Lenna.bmp

............此處省略265個文件信息

評論

共有 條評論