Eroding an Image
To erode an image, use the imerode function. The imerode 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
imerode also accepts three optional arguments: SHAPE, PACKOPT, and M.
The SHAPE argument affects the size of the output image. The PACKOPT argument identifies the input image as packed binary. If the image is packed binary, M identifies the number of rows in the original image. (Packing is a method of compressing binary images that can speed up the processing of the image. See the bwpack reference page for more information.)