|Image Processing Toolbox User's Guide|
Combining Dilation and Erosion
Dilation and erosion are often used in combination to implement image processing operations. For example, the definition of a morphological opening of an image is an erosion followed by a dilation, using the same structuring element for both operations. The related operation, morphological closing of an image, is the reverse: it consists of dilation followed by an erosion with the same structuring element.
The following section uses
imerode to illustrate how to implement a morphological opening. Note, however, that the toolbox already includes the
imopen function, which performs this processing. The toolbox includes functions that perform many common morphological operations. See Dilation- and Erosion-Based Functions for a complete list.
You can use morphological opening to remove small objects from an image while preserving the shape and size of larger objects in the image. For example, you can use the
imopen function to remove all the circuit lines from the original circuit image,
circbw.tif, creating an output image that contains only the rectangular shapes of the microchips.
To morphologically open the image, perform these steps:
|Eroding an Image||Dilation- and Erosion-Based Functions|
© 1994-2005 The MathWorks, Inc.