
296 A Computational Introduction to Digital Image Processing, Second Edition
10.8 Grayscale Morphology
The operations of erosion and dilation can be generalized to be applied to grayscale
images. But before we do, we shall reconsider binary erosion and dilation. We have defined
binary erosion, A B, to be the union of the (0, 0) positions of all translations B
x
for which
B
x
⊆ A.
Suppose we take B to be a 3 ×3 square consisting entirely of zeros. Let A be the image
as shown in Figure 10.31. Now suppose we move over the image A, and for each point p we
0 0 0 0 0 0 0 0
0 1 1 1 1 0 0 0
0 1 1 1 1 1 0 0
0 1 1 1 1 1 1 0
0 1 1 1 1 1 1 0
0 0 1 1 1 1 1 0
0 0 0 1 1 1