function imblur=blur(imw,filtersize);

% imblur=BLUR(imw,filtersize);
%
% 		Blurs the image file IMW
%
%		filtersize: size of convolution mask
%                   min: 2, max: image size
%
%		e.g.: imblur=blur(imw,3);
%
%
% University of Rhode Island
% Dept. of Electrical Engineering
% Roger Meier, May '99


if filtersize < 2
	disp('filter size too small')
	break
end

filt=ones(filtersize,filtersize)/filtersize^2;
imblur(:,:,1)=filter2(filt,imw(:,:,1),'same');
imblur(:,:,2)=filter2(filt,imw(:,:,2),'same');
imblur(:,:,3)=filter2(filt,imw(:,:,3),'same');
imblur=uint8(imblur);
