Dilating an Image
To dilate an image, use the imdilate function. The imdilate function accepts two primary arguments:
• The input image to be processed (grayscale, binary, or packed binary image)
• A structuring element object, returned by the strel function, or a binary matrix defining the neighborhood of a structuring element
imdilate also accepts two optional arguments: SHAPE and PACKOPT. The SHAPE argument affects the size of the output image. The PACKOPT argument identifies the input image as packed binary. (Packing is a method of compressing binary images that can speed up the processing of the image. See the bwpack reference page for information.)
This example dilates a simple binary image containing one rectangular object.