Objective
Apply erosion and dilation to a binary image and watch the structuring element grow, shrink, open and close the shapes.
The idea
Morphology works on shapes, not shades. Erosion shrinks bright regions, dilation grows them; opening and closing combine the two.
Try this
- 1Erode and watch thin structures disappear.
- 2Dilate and watch holes fill and blobs swell.
- 3Apply opening to remove noise specks.
- 4Apply closing to join nearby broken parts.
Watch for
- Erosion keeps a pixel only if the whole kernel fits.
- Dilation lights a pixel if the kernel touches one.
- Opening = erode then dilate (removes specks).
- Closing = dilate then erode (fills holes).