% By Ramón Morneo jiménez
% natafresa@gmail.com
% Computational Intelligence Group
% http://www.ehu.es/ccwintco


%% an experiment 


dr = '../../img/'; %%image directory

outdr = '../out/SF3/';

d = dir(dr);

for i = 3:size(d,1)
    fname = d(i).name;
    fname2 = strcat(dr ,fname);
    I = imread(fname2);
    % P = Perimeter
    % C = Centroid
    [P , C] = Segmentation2(I, .25, 2);
    P = round(P);
    for j = 1:size(P,1)
        I(P(j,1),P(j,2),:)=[0,255,0]; % mark in green
    end
    
    %%save the segmented image
    fout = strcat(outdr , fname); 
  
    imwrite(I,fout);
  
    
end
