Page 144 -
P. 144
118 Chapter 3 ■ Digital Morphology
(a) (b) (c)
(d) (e)
Figure 3.20: Conditional dilation. (a) Image of a pile of keys. (b) Negative image resulting
from use of a high threshold. (c) Result of using a low threshold. (d) Conditional dilation
of (b) using the simple structuring element, conditional on (c). (e) The result after being
cleaned up — in this case, by using an opening.
Another application of conditional dilation is that of filling a region with
pixels, which is the inverse operation of boundary extraction. Given an outline
of black pixels and a pixel inside of the outline, we are to fill the region with
black pixels. In this case, the forbidden image will consist of the boundary
pixels; we want to fill the region up to the boundary, but never set a pixel that is
outside. Because the outside pixels and the inside pixels have the same value,
the boundary pixels are forbidden and the dilation continues until the inside
region is all black. Then this image and the boundary image are combined to
form the final result.
The conditional dilation is:
c
Fill = P ⊕ (S cross , A ) (EQ 3.26)
where P is an image containing only the seed pixel, which is any pixel known
to be inside the region to be filled, and A is the boundary image for the region
to be filled. S cross is the cross-shaped structuring element seen in Figure 3.21b.
The same figure shows the steps in the conditional dilation that fills the same
boundary that was identified in section 3.2.8. The seed pixel used in the
example is [3,3], but any of the white pixels inside the boundary could have
been used.