% Example 9.5
% a)   Original
f=imread('small-squares.tif');
imshow(f)
pause
%  b)  Opening of a)
%B1=strel([0 0 0; 0 1 1; 0 1 0]);  % Both ways work
B1=[0 0 0; 0 1 1; 0 1 0];
B2=strel([1 1 1; 1 0 0; 1 0 0]);
g=bwhitmiss(f,B1,B2);
figure; imshow(g)
pause

close all