% M-Script to test the filtering concept
%
% Authors: Borgo, Soranzo, Grassi
% Date: 2009

Filter = ones(3,3)*1/9; % generate the filter
ImageTest=ones(20,20)*255; % generate a white image
ImageTest(:,9:11)=1; % Plot a three-pixel-width vertical line

Filtered=filter2(Filter, ImageTest, 'same'); % do the filtering

figure; % show the original and filtered image
subplot(1,2,1)
image(ImageTest);
title('Original Image');
subplot(1,2,2)
image(Filtered);
title('Filtered Image');
colormap(gray(255));