Image Processing Toolbox    

Perform erosion on a binary image



BW2 = erode(BW1,SE) performs erosion on the binary image BW1, using the binary structuring element SE. SE is a matrix containing only 1's and 0's.

BW2 = erode(BW1,SE,alg) performs erosion using the specified algorithm. alg is a string that can have one of these values:

Both algorithms produce the same result, but they make different tradeoffs between speed and memory use. The frequency algorithm is faster for large images and structuring elements than the spatial algorithm, but uses much more memory.

BW2 = erode(BW1,SE,...,n) performs the erosion operation n times.

Class Support

The input image BW1 can be of class double or uint8. The output image BW2 is of class uint8.


You should use the frequency algorithm only if you have a large amount of memory on your system. If you use this algorithm with insufficient memory, it may actually be slower than the spatial algorithm, due to virtual memory paging. If the frequency algorithm slows down your system excessively, or if you receive "out of memory" messages, use the spatial algorithm instead.


See Also

bwmorph, imdilate, imerode


[1]  Gonzalez, Rafael C., and Richard E. Woods. Digital Image Processing. Addison-Wesley, 1992. p. 518.

[2]  Haralick, Robert M., and Linda G. Shapiro. Computer and Robot Vision, Volume I. Addison-Wesley, 1992. p. 158.

  edgetaper fft2