A mask can contain unwanted specks and legitimate fine features at the same time. An operation that removes one may also alter the other.
OpenCV describes morphological operations such as erosion and dilation using structuring elements. OpenCV — morphology.
Inspect the smallest relevant feature
For a character outline, check narrow ears, stitched details and gaps after processing. The acceptable operation depends on the feature the task is meant to preserve.

Keep the transformation traceable
Record the method and its parameters with the derived mask. Do not treat a smoother boundary as more accurate without comparing it to an appropriate reference. Image cleanup should support the decision, not quietly redefine what counts as part of the product.

Source reviewed 25 October 2026. Interpretation and original diagrams: PLUSHIP / Qunhe. Examples are illustrative.
Related reading
A Crop Can Remove the Evidence Needed for a Vision Decision
Feature Selection Changes Which Inputs a Model Can Use
Object Detection Can Locate a Detail Without Measuring Its Quality
