Image Processing Toolbox User's Guide Previous page   Next Page

Dilating an Image

To dilate an image, use the imdilate function. The imdilate function accepts two primary arguments:

imdilate also accepts two optional arguments: PADOPT and PACKOPT. The PADOPT 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.

To expand all sides of the foreground component, the example uses a 3-by-3 square structuring element object. (For more information about using the strel function, see Structuring Elements.)

To dilate the image, pass the image BW and the structuring element SE to the imdilate function. Note how dilation adds a rank of 1's to all sides of the foreground object.

Previous page  Structuring Elements Eroding an Image Next page

© 1994-2005 The MathWorks, Inc.