0001 function WBCmain()
0002
0003 clc;
0004 P = initParam('wbc');
0005
0006 for seq = 1: length(P.IFOLDERS)
0007 fprintf('\nDetecting at sequence %s', P.IFOLDERS(seq).Name);
0008 if ~exist(strcat(P.IFOLDERS(seq).Name,'/ADA'),'dir')
0009 mkdir(strcat(P.IFOLDERS(seq).Name,'/ADA'));
0010 end
0011 if ~exist(strcat(P.IFOLDERS(seq).Name,'/VIS'),'dir')
0012 mkdir(strcat(P.IFOLDERS(seq).Name,'/VIS'));
0013 end
0014 for subSeq = 1: size(P.IFOLDERS(seq).Ra,1)
0015 frStart = P.IFOLDERS(seq).Ra(subSeq,1);
0016 frEnd = P.IFOLDERS(seq).Ra(subSeq,2);
0017 for fr = frStart: frEnd
0018
0019 im = im_get (P.IFOLDERS(seq).Name, fr,P.EXTENSION);
0020 tic;
0021 fprintf('\nSequence %s , frame %d', P.IFOLDERS(seq).Name, fr);
0022
0023 imBinary = adaBoost_detect(im, P );
0024 adaName = strcat(P.IFOLDERS(seq).Name,'/ADA/ADA_',...
0025 P.IFOLDERS(seq).Name,num2str(fr),'.png');
0026 imwrite(imBinary, adaName);
0027
0028
0029 visName = strcat(P.IFOLDERS(seq).Name,'/VIS/VIS_',...
0030 P.IFOLDERS(seq).Name,num2str(fr),'.png');
0031
0032 cellBoundary = edge(imBinary,'canny');
0033 im(cellBoundary==1) = 1;
0034 imwrite(im,visName);
0035 t = toc;
0036 fprintf(' in %3.0f seconds.', t);
0037 end
0038 end
0039 end