Morphological Post-Processing¶
After binarization, morphological operations clean up the mask:
Opening: removes small foreground fragments (noise).
Closing: fills small holes in particles.
Fill holes: fills enclosed background regions.
Remove small objects: discards connected components below a minimum area threshold.
See also
Morphological Operations — the underlying operations, in depth
Connected Components — labelling what’s left after clean-up
Binarization and Thresholding — producing the mask this step cleans up
Image Preprocessing — every other preprocessing operation