Figure 5.34 - Closing by a flat disk
A useful geometric intuition of the closing filter when applied to a gray-scale image can be seen in Fig. 5.34, from the image surface representation. Closing can be seen as a process where plaster is coated on the surface and the excess is removed by a tool shaped by the structuring element (in this case a flat disk) which can translate but not rotate. The two left-side pictures of Fig. 5.34 (a) and (c) are the shade representations of the input and closed images. The two pictures on the right are their equivalent surface representations. Fig. 5.34 (b) and (d) Note how the narrow tick markers of the closed ruler are coated, whereas the thick numbers are recovered because the tool tip can fit inside them to remove the plaster excess.
1 import ia870 as MT 2 3 f = adreadgray('mm3.tif') 4 D = MT.iasedisk(3) 5 g = MT.iaclose(f,D) 6 7 adshow(f, '(a)') 8 adshow(MT.iagsurf(f), '(b)') 9 10 adshow(g, '(c)') 11 adshow(MT.iagsurf(g), '(d)')