Morphological Image Processing - Study Notes
1. Fundamentals
Morphological processing is used for analyzing and processing geometrical structures.
It works best on binary images, but can be extended to grayscale images.
It uses a structuring element (SE) a small shape or template to probe the image.
2. Erosion and Dilation
Erosion (-): Shrinks or thins objects, removes boundary pixels. Removes small noise.
Formula: A - B = {z | B translated by z is completely inside A}
Dilation (+): Expands or thickens objects, adds boundary pixels. Fills small holes.
Formula: A + B = {z | the intersection of B and A is not empty when B is shifted by z}
3. Opening and Closing
Opening (open): Erosion followed by Dilation. Removes small objects while preserving shape.
Formula: A open B = (A - B) + B
Closing (close): Dilation followed by Erosion. Fills small holes or gaps in objects.
Formula: A close B = (A + B) - B
4. Hit-or-Miss Transform
Used to detect a specific pattern or shape in the image.
Formula: A x B = (A - B1) intersect (Ac - B2), where B1 and B2 are SEs for object and background.
5. Basic Morphological Algorithms
- Boundary Extraction: Boundary = A (A - B)
- Hole Filling: Fill internal holes using reconstruction.
- Connected Component Labeling: Identifies and labels individual connected objects.
- Thinning: Reduces thickness to 1-pixel wide skeleton.
Morphological Image Processing - Study Notes
- Thickening: Grows features without merging objects.
6. Morphological Reconstruction
Uses a marker and a mask image.
Reconstruction by Dilation: Iterative dilation of marker constrained by mask.
Applications: Remove small objects, fill gaps, background subtraction.
7. Grayscale Morphology
- Grayscale Dilation: Max of neighborhood; brightens features.
- Grayscale Erosion: Min of neighborhood; darkens features.
- Opening/Closing work on intensity values.
Uses: Noise removal, smoothing, edge detection.
Quick Comparison Table
Operation | Function | Effect
Erosion (-) | Shrinks objects | Removes noise, separates objects
Dilation (+) | Expands objects | Fills holes, connects parts
Opening (open) | Erosion Dilation | Removes small objects
Closing (close) | Dilation Erosion | Fills small holes
Hit-or-Miss (x) | Pattern matching | Shape detection
Reconstruction | Rebuild shapes | Remove noise, fill gaps
Grayscale Morphology | Intensity-based | Smoothing, enhancement