Page 143 -
P. 143
Chapter 3 ■ Digital Morphology 117
parts of an image then a dilation of the object must not intrude into that area.
In that case, a conditional dilation can be performed. The forbidden area of the
image is specified as a second image in which the forbidden pixels are black
(1). The notation for conditional dilation will be:
A ⊕ (S , A ) (EQ 3.23)
e
where S e is the structuring element to be used in the dilation, and A’is the
image representing the set of forbidden pixels.
One place where this is useful is in segmenting an image. Determining a
good threshold for grey-level segmentation can be difficult, as discussed later
in Chapter 3. However, sometimes two bad thresholds can be used instead of
one good one. If a very high threshold is applied to an image, only those pixels
that have a high likelihood of belonging to an object will remain. Of course, a
great many will be missed. Now a very low threshold can be applied to the
original image, giving an image that has too many object pixels, but where the
background is marked with some certainty. Then the following conditional
dilation is performed:
R = I high ⊕ (simple, I low ) (EQ 3.24)
The image R is now a segmented version of the original, and it is in some
cases a superior result than could be achieved using any single threshold
(Figure 3.20).
The conditional dilation is computed in an iterative fashion. Using the
notation of Equation 3.23, let A 0 = A. Each step of the dilation is computed by:
A i = (A i−1 ⊕ S e ) ∩ A (EQ 3.25)
The process continues until A i = A i−1 ,atwhich point A i is the desired
dilation. A MAX program for conditional dilation is:
// Conditional dilation
image a, b, c, d;
begin
doa<< ˝ $1˝; // Input image.
doc<< ˝ $2˝; // Forbidden image.
b := {[3,3], [1,1], ˝ 111111111˝}; // Simple structuring element.
loop
d :=(a++b)* c;
exit when d=a;
a:= d;
end;
doa>> ˝ $3˝;
end;