function [] = PreProcessImages(arg, argoption)



% directoryname = uigetdir(pwd);
% files = dir([directoryname, filesep, '*.JPG']);
% files = {files.name};
% s = input('What resize ratio : ', 's'); 
% s = str2num(s);
% w = waitbar(0, 'Resizing Files...');
% for f = 1:length(files)
%     waitbar(f/length(files), w);
%    I = imread([directoryname, filesep,files{f}]);
%    I = imresize(I, s);
%    imagesc(I);
%    axis image;
%    BW = roipoly;
%    L = bwlabel(BW);
%    S = regionprops(L, 'BoundingBox');
%    R = S(1).BoundingBox;
%    I2 = imcrop(I,R); 
%    imwrite(I2, [directoryname, filesep,files{f}]);
% end
% close(w);
% return;