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

資源簡介

蟻群算法用于圖像邊緣檢測,matlab程序,非常經典,測試通過的。

資源截圖

代碼片段和文件信息

function?func_ant_colony_image_edge_detection
%
%
%?This?is?a?demo?program?of?image?edge?detection?using?ant?colony?based?on
%?the?paper?“An?Ant?Colony?Optimization?Algorithm?For?Image?Edge
%?Detection“?IEEE?Congress?on?Evolutionary?Computation?(CEC)?pp.?751-756?Hongkong
%?Jun.?2008.
%
%
%
%?Input:
%?gray?image?with?a?square?size
%
%?Output:
%?four?edge?map?images?which?are?obtained?by?the?method?using?four?functions
%?respectively.
%

%?image?loading
filename?=?‘camera128‘;

img?=?double(imread([filename?‘.bmp‘]))./255;
[nrow?ncol]?=?size(img);

%visiblity?function?initialization?see?equation?(4)

for?nMethod?=?1:4;
????%Four?kernel?functions?used?in?the?paper?see?equations?(7)-(10)
????%E:?exponential;?F:?flat;?G:?gaussian;?S:Sine;?T:Turkey;?W:Wave


????fprintf(‘Welcome?to?demo?program?of?image?edge?detection?using?ant?colony.\nPlease?wait......\n‘);

????v?=?zeros(size(img));
????v_norm?=?0;
????for?rr?=1:nrow
????????for?cc=1:ncol
????????????%defination?of?clique
????????????temp1?=?[rr-2?cc-1;?rr-2?cc+1;?rr-1?cc-2;?rr-1?cc-1;?rr-1?cc;?rr-1?cc+1;?rr-1?cc+2;?rr?cc-1];
????????????temp2?=?[rr+2?cc+1;?rr+2?cc-1;?rr+1?cc+2;?rr+1?cc+1;?rr+1?cc;?rr+1?cc-1;?rr+1?cc-2;?rr?cc+1];

????????????temp0?=?find(temp1(:1)>=1?&?temp1(:1)<=nrow?&?temp1(:2)>=1?&?temp1(:2)<=ncol?&?temp2(:1)>=1?&?temp2(:1)<=nrow?&?temp2(:2)>=1?&?temp2(:2)<=ncol);

????????????temp11?=?temp1(temp0?:);
????????????temp22?=?temp2(temp0?:);

????????????temp00?=?zeros(size(temp111));
????????????for?kk?=?1:size(temp111)
????????????????temp00(kk)?=?abs(img(temp11(kk1)?temp11(kk2))-img(temp22(kk1)?temp22(kk2)));
????????????end

????????????if?size(temp111)?==?0
????????????????v(rr?cc)?=?0;
????????????????v_norm?=?v_norm?+?v(rr?cc);
????????????else
????????????????lambda?=?10;
????????????????switch?nMethod

????????????????????case?1%‘F‘
????????????????????????temp00?=?lambda?.*?temp00;????????

????????????????????case?2%‘Q‘
????????????????????????temp00?=?lambda?.*?temp00.^2;???????

????????????????????case?3%‘S‘
????????????????????????temp00?=?sin(pi?.*?temp00./2./lambda);

????????????????????case?4%‘W‘
????????????????????????temp00?=?sin(pi.*temp00./lambda).*pi.*temp00./lambda;
????????????????end

????????????????v(rr?cc)?=?sum(sum(temp00.^2));
????????????????v_norm?=?v_norm?+?v(rr?cc);
????????????end
????????end
????end

????v?=?v./v_norm;??%do?normalization


????v?=?v.*100;
????%?pheromone?function?initialization
????p?=?0.0001?.*?ones(size(img));?????


????%paramete?setting?see?Section?IV?in?CEC?paper
????alpha?=?1;??????%equation?(4)
????beta?=?0.1;?????%equation?(4)
????rho?=?0.1;??????%equation?(11)
????phi?=?0.05;?????%equation?(12)?i.e.?(9)?in?IEEE-CIM-06


????ant_total_num?=?round(sqrt(nrow*ncol));

????ant_pos_idx?=?zeros(ant_total_num?2);?%?record?the?location?of?ant

????%?initialize?the?positions?of?ants

????rand(‘s

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

?????文件??????17462??2003-03-28?16:53??ant_colony_image_edge_detection\camera128.bmp

?????文件??????17462??2009-04-03?18:41??ant_colony_image_edge_detection\camera128_edge_aco_1.bmp

?????文件??????17462??2009-04-03?18:42??ant_colony_image_edge_detection\camera128_edge_aco_2.bmp

?????文件??????17462??2009-04-03?18:43??ant_colony_image_edge_detection\camera128_edge_aco_3.bmp

?????文件??????17462??2009-04-03?18:45??ant_colony_image_edge_detection\camera128_edge_aco_4.bmp

?????文件??????12128??2008-09-04?16:51??ant_colony_image_edge_detection\func_ant_colony_image_edge_detection.m

?????文件?????????43??2009-05-25?21:24??ant_colony_image_edge_detection\Untitled.m

?????目錄??????????0??2009-06-13?18:33??ant_colony_image_edge_detection

-----------?---------??----------?-----??----

????????????????99481????????????????????8


評論

共有 條評論