% grapple3.m applies median filters with succesively larger windows G = imread('grapple.gif'); % read the .gif file clf subplot(3,3,1) imshow(G,[0 1]); % display the image with 2 gray levels title('Original image') drawnow for i=2:9, q = 2*i-1; % width of filter window G = medfilt2(G,[q q],'symmetric'); % use this size filter twice G = medfilt2(G,[q q],'symmetric'); subplot(3,3,i) imshow(G,[0 1]); title(['After ' int2str(q) ' by ' int2str(q) ' median filter']); drawnow end