Dilation is one of the two basic operators in the area of mathematical morphology, the other being erosion. The basic effect of the operator on a binary image is to gradually enlarge the boundaries of regions of foreground pixels (i.e. white pixels, typically). Thus areas of foreground pixels grow in size while holes within those regions become smaller.
To compute the dilation of a binary input image by the kernel,we consider each of the background pixels in the input image in turn. For each background pixel (which we will call the input pixel) we superimpose the kernel on top of the input image so that the origin (center) of the kernel coincides with the input pixel position. If at least one pixel in the kernel coincides with a foreground pixel in the image underneath, then the input pixel is set to the foreground value. If all the corresponding pixels in the image are background, however, the input pixel is left at the background value.
The figures below illustrate the operation of a dilation. The
figure on the left shows objects in a binary image. The figure on the right
shows the same objects after dilation with the kernel in the center(origin in
blue).
Grayscale dilation with a flat disk shaped kernel will generally brighten the image. Bright regions surrounded by dark regions grow in size, and dark regions surrounded by bright regions shrink in size. Small dark spots in images will disappear as they are `filled in' to the surrounding intensity value. Small bright spots will become larger spots. The effect is most marked at places in the image where the intensity changes rapidly and regions of fairly uniform intensity will be largely unchanged except at their edges. Figure 3 shows a vertical cross-section through a graylevel image and the effect of dilation using a disk shaped kernel.
The figures below illustrate the operation of a dilation. The figure on the left shows the umbra of a line in a grayscale image. The figure on the right shows the umbra of the same line after dilation with the kernel in the center(origin in the middle)