Mathematical morphology 2026-11-05
Mathematical morphology studies shape-transforming operations defined through a chosen structuring element. For foreground pixels represented as a set and a finite footprint , morphological dilation is
while morphological erosion is . Dilation adds footprint translates around the foreground; erosion retains placements whose entire footprint fits.
For a one-dimensional example, and give dilation and erosion . Morphological opening, erosion followed by dilation with the same footprint, removes an isolated set for that footprint because neither placement contains two consecutive points. grayscale variants use local minima and maxima rather than binary membership. The footprint and boundary conventions determine the exact operation.[ref]
Morphological dilation 2026-11-05
For foreground set and structuring element , morphological dilation is their Minkowski sum:
Equivalently, place a translated copy of at each foreground position and take their union. For and , the result is , connecting the separated input points.
In image processing, morphological dilation can enlarge bright regions or bridge small gaps. The grayscale version for a flat footprint takes a local maximum, with the footprint reflected according to the stated offset convention.[ref] Asymmetric footprints make reflection conventions visible; symmetric disks hide that distinction. Morphological dilation alone generally enlarges a region, whereas morphological opening combines it with morphological erosion.
Morphological erosion 2026-11-05
For foreground set and structuring element , morphological erosion is
Thus an output position is retained only when every offset in the translated structuring element lands inside the foreground. This can shrink regions and remove features narrower than the neighborhood.[ref]
For and , only starts zero and one have their successor in , giving . The point five disappears. For grayscale data with a flat footprint, the analogous operation takes a local minimum. An image implementation additionally chooses border rules; the set formula assumes the ambient space outside is background.
Morphological opening 2026-11-05
Morphological opening applies morphological erosion and then morphological dilation with the same structuring element. For a foreground set and structuring element ,
It keeps the union of all translated copies of contained in . Consequently the result is contained in , and repeating the operation changes nothing: morphological opening is idempotent.
For a one-dimensional example, take and . Morphological erosion gives and the following morphological dilation restores ; the isolated point at five disappears. The surviving run is restored rather than shifted. In image processing, selecting the structuring element controls which bright features survive. Scikit-image demonstrates removal of bright regions too thin to contain the chosen footprint.[ref]
Structuring element 2026-11-05
A structuring element specifies the neighborhood shape and reference position used by an operation in mathematical morphology. In binary image processing, represent it as a finite set of offsets. Morphological erosion tests where a translated fits inside the foreground; morphological dilation adds its offsets to foreground positions.
A three-by-three square uses all nine offsets around its center, while a cross uses the center and its four horizontal or vertical neighbors. They treat diagonal features differently despite having the same width. Scikit-image's morphology demonstration uses a disk-shaped footprint whose radius controls the affected scale.[ref] The reference position matters for asymmetric shapes, and finite-image border rules must specify how neighborhoods outside the image are treated.