Name

erosion - Calculate the eroded image (for both binary and graylevel image).

Usage

output = erosion(input, mask, morphtype = "morph_type")

Input

input
The first input image
mask
The second input image used as the mask (default: image of size n^3 filled with ones).
  • The size of the mask has to be odd so that the center of mask can be well defined.
  • The size of the mask should be smaller than the size of the first input image.
morph_type
Type of the erosion
  • BINARY is for binary erosion (DEFAULT);
  • GRAYLEVEL is for graylevel erosion.

Output

output
eroded image

Method

  1. For erosion binary, the output image is defined as the Minkowski substraction of the two input images A-B=(Ac+B)c

  2. For erosion graylevel, the output image is defined as A-B=min[A(x+i,y+j)-B(i,j)]

Reference

H. R. Myler and A. R. Weeks, "The Pocket Handbook of Image Processing Algorithms in C," Prentice Hall: Upper Saddle River, New Jersey, 1993.

Author / Maintainer

Pawel A. Penczek

Keywords

category 1
MORPHOLOGY
category 2
SPATIAL, NONLINEAR

Files

morphology.py

See also

Maturity

stable
works for most people, has been tested; test cases/examples available.

Bugs

None. It is perfect.

erosion (last edited 2013-07-01 13:13:03 by localhost)