% Example 9.4
f=imread('shapes.tif');
imshow(f)               % Show original Fig.9.10a 
pause

se=strel('square',20);
fo=imopen(f,se);
figure,imshow(fo)       % Show b
pause

fc=imclose(f,se);
figure,imshow(fc)       % Show c
pause

foc=imclose(fo,se);
figure,imshow(foc)       % Show d
pause

close all