pymagery — python imagery
1.8.0 documentation / morph_open plugin
The morph_open plugin performs morphological open of a monochrome image (an erosion followed by a dilation). Opening has the general purpose of removing narrow lines smaller than the mask. It is closely related to the close operation.
The plugin prototype is:
The mask must be another monochrome image and the origin is a zero-based two-tuple of the position that should be considered the origin of the mask. For square-masks of odd dimensions typically have the center pixel ((width-1)/2) as the origin. Of course, masks need not be square nor be fully filled in.
The following example opens the image with a 5x5 mask (center is the origin):
The following is the result of erosion and opening of a 5x5 mask to an image.
Original Mask Eroded Image Opened Image
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
In this case the erosion mask did not remove narrow strips in the bottom, thus the image has not changed because of the closing. Repeating the open operation with a 13x13 mask is big enough to remove the strips:
Original Eroded Image Opened Image
Change Log
- 1.8.0 — added




