Image Morphology (Erosion & Dilation)
Theory
Morphology operates on the structure of objects in a binary image using a structuring element B.
Erosion (A ⊖ B)
- Shrinks foreground objects.
- Removes small noise.
- Reduces object boundaries.
Dilation (A ⊕ B)
- Expands foreground objects.
- Fills small gaps.
Opening
- Erosion followed by dilation.
- Removes small noise objects.
Closing
- Dilation followed by erosion.
- Fills small holes and gaps.