一些图像的形态学操作，主要包括Erosion, Dilation, Closing 和 Opening.
Erosion and Dilation:
The erosion of an image is equivalent to the complement of the
dilation of the complement image
The dilation of an image is equivalent to the complement of the
erosion of the complement image
Closing and Opening:
The opening and closing filters are simply defined in terms of the basic
erosion and dilation operations. Closing is defined as the erosion of the
dilation of an image. Opening is defined as the dilation of the erosion of
Note that applying the same opening (and similarly the closing) operator on an image several times has no effect. Indeed, as the holes have been filled by the first opening filter, an additional application of the same filter will not produce any other changes to the image. In mathematical terms, these operators are said to be idempotent.
A good way to understand the effect of morphological operators on a
gray-level image is to consider an image as a topological relief in which
the gray levels correspond to elevation (or altitude).
morphological gradient: extracting the edges of an image
top-hat transform: extract local small foreground objects