資源簡(jiǎn)介
基于遺傳算法的圖像分割,使用遺傳算法分割圖像。
代碼片段和文件信息
function?[newpop]=crossover(oldpopstringlengthabpc);
pops=size(oldpop1);
newpop=zeros(size(oldpop));
for?i=1:pops/2
????if(rand ??????????cpoint=round(rand*(stringlength-2))+1;
??????????newpop(i:)=[oldpop(i1:cpoint)oldpop(pops/2+icpoint+1:stringlength)00];
??????????newpop(pops/2+i:)=[oldpop(pops/2+i1:cpoint)oldpop(icpoint+1:stringlength)00];?????????
????else
??????????newpop(i:)=oldpop(i:);
??????????newpop(pops/2+i:)=oldpop(pops/2+i:);
????end
end
for?i=1:pops
?????sum=0;
?????for?j=1:stringlength
?????????sum=sum+newpop(ij)*2^(j-1);??
?????end
?????????newpop(istringlength+1)=sum;%解碼
?????????x=newpop(istringlength+1);
?????????newpop(istringlength+2)=fitness(xpopsstringlength);????
end
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????754??2009-05-09?09:20??基于遺傳算法的圖像分割\crossover.m
?????文件????????761??2009-06-01?11:33??基于遺傳算法的圖像分割\fitness.m
?????文件????????845??2009-06-01?11:35??基于遺傳算法的圖像分割\ga.m
?????文件???????1062??2009-06-01?11:33??基于遺傳算法的圖像分割\initialise.m
?????文件????????491??2005-04-19?09:38??基于遺傳算法的圖像分割\mutation.m
?????文件????????494??2005-04-11?22:42??基于遺傳算法的圖像分割\roulette.m
?????目錄??????????0??2010-12-27?13:42??基于遺傳算法的圖像分割
-----------?---------??----------?-----??----
?????????????????4407????????????????????7
- 上一篇:Zernike 亞像素邊緣檢測(cè)的matlab代碼
- 下一篇:CDD
評(píng)論
共有 條評(píng)論