Morphological Image Processing
Goal: To implement binary dilation and erosion
with a 3x3 structuring element.
I implemented these algorithms in
matlab. Neither implementation follows
of dilation and erosion. But they
should behave the same as the definitions
long as the structuring element is smaller than the object. If the object is very small,
will completely remove it. All images
are required to be binary (1 - white, 0 black).
the origin will always be at the center of the structuring element. I ran one erosion
one dilation on figure 9.14a as a demonstration. I used the following element for both
= [1 1 1
0 1 1
0 0 1]
is clear where the image has been eroded.
It is more difficult to tell what happened with
dilation. But, you should be able to see the extra
'mass' at the end of the nose. And the
the hair meets the forehead has filled in some.
Top) The original image with threshold at 1.
Middle) Eroded image.
Bottom) Dilated image.
is some more matlab code to perform some routine set functions.
these could in principle be used in dilation and erosion, none
used in my implementation.