Implements the morphologicdilation operator for shape processing.
structure The structuring element. May be a one- or two-dimensional array. Elements are interpreted as binary (values are either zero or nonzero), unless the Gray keyword is used.
x0 (optional) The x-coordinates of structure's origin.
y0 (optional) The y-coordinates of structure's origin.
Values An array providing the values of the structuring element. Must have the same dimensions and number of elements as structure.
The optional parameters x0 and y0 specify the row and column coordinates of the structuring element's origin. If omitted, the origin is set to the center, ( Nx / 2 , Ny / 2 ), where Nx and Ny are the dimensions of the structuring element array. However, the origin need not be within the structuring element.
Nonzero elements of the structure parameter determine the shape of the structuring element (neighborhood).
If the Values keyword is not used, all elements of the structuring element are 0, yielding the neighborhood maximum operator.
You can choose whether you want to use gray scale or binary dilation:
DILATE returns the dilation of image by the structuring element, structure. This operation is also commonly known as filling, expanding, or growing. It can be used to fill holes that are equal in size or smaller than the structuring element, or to grow features contained within an image. The result is an image that contains items that may touch each other and become one. Sharp-edged items and harsh angles typically become dull as they expand and grow.
NOTE: Dilation can be used to change the morphological structure of objects or features in an image to see what would happen if they were to actually expand over time.
Used with binary images, where each pixel is either 1 or 0, dilation is similar to convolution. On each pixel of the image, the origin of the structuring element is overlaid. If the image pixel is nonzero, each pixel of the structuring element is added to the result using the logical OR operator.
Letting
where (A)b represents the translation of A by b. Intuitively, for each nonzero element bij of B, A is translated by i,j and summed into C using the OR operator.
where the erosion operator is denoted by and is implemented by the ERODE function.
As stated by Haralick et al:
"The result of iteratively applied dilations and erosions is an elimination of specific image detail smaller than the structuring element without the global geometric distortion of unsuppressed features. For example, opening an image with a disk structuring element smooths the contour, breaks narrow isthmuses, and eliminates small islands and sharp peaks or capes.
Closing an image with a disk structuring element smooths the contours, fuses narrow breaks and long thin gulfs, eliminates small holes, and fills gaps on the contours."
img = DILATE(aerial_img, struct, /Gray)
struct
has a value of [1 0 1].
Figure 2-29 The DILATE function has been used to fuse the visual elements of this 512-by-512 aerial image.
Figure 2-30 The DILATE function has been used to fuse the visual elements of this 512-by-512 aerial image.