Statistical Methods

Audit What a Morphological Opening Removes from a Mask

Define the task

A morphological opening is erosion followed by dilation using a specified footprint. It can remove isolated foreground and narrow features, but those features may be scientifically real. Record the entire footprint, its origin, iteration count and outside-array value. A footprint's dimensions alone are insufficient: a five-cell cross and a filled 3×3 square act differently on the same mask.

Carry out the check

For the teaching tool, use one centered cross erosion followed by one cross dilation, treating outside cells as zero. Erosion retains a cell only when it and its four direct neighbors are foreground. Dilation then expands the surviving cells by that same cross. Inspect the changed locations and save both masks. Do not describe the result as improved segmentation without independent evidence. This operation is distinct from filling enclosed background holes.

Worked hypothetical example

Hypothetical example: rows [0,1,0], [1,1,1], [0,1,0] form a five-cell cross. Erosion leaves its center; dilation reconstructs all five cells, so the opening preserves it. A single central foreground cell erodes away and cannot return during dilation. The result demonstrates footprint dependence, not a recommended minimum object size. If pixel spacing differs by axis, the cross also has unequal physical reach; report that explicitly.

Method checked 23 November 2026 against Primary method documentation: binary_opening.

Open the cross-footprint mask opening.

Download the morphology footprint worksheet.

Related reading

Reading path: Analyze data. Guide 207 of 222. Choose any guide to suit your project.

Statistical Methods

Decide Which Enclosed Background a Mask May Fill

Practical steps and a hypothetical example: Audit enclosed background before changing a binary mask.

Statistical Methods

Record the Mask and Connectivity for Seeded Region Growth

Practical steps and a hypothetical example: Define seed-constrained reachability inside an allowed mask.

Browse this reading pathTools for this stageGuides and downloads for this stage