Morphology Operators

This page describes the interfaces for the basic morphology operators that you can use to build your own pipeline. To easily visualize the effect of different operators, the "blobs" image is used to build the cover image.

using TestImages, ImageBase
restrict(testimage("blobs"))
color image is not supported

Unless explicitly used, most operations in this package don't support color images. This is because many morphological operation is based on pixel value comparisons min, max, > and < – they are not well-defined for RGB type.

🚧 work in progress

This page contains only a subset of exported functions. The missing ones will be added in the future. You might need to check the heavy reference page to find out what you need. Contributions are welcome!

Operators

list-card-cover-image

The extreme_filter function is the core operation in ImageMorphology. Many other morphological operations such as dilate and erode are direct usages of it. The cover image shows a pixel jitter using random select function.

list-card-cover-image

The dilation operator dilate is essentially a max filter. This is a basic term in mathematical morphology – many operations are built on top of dilate and the erode operator.

list-card-cover-image

The dilation operator erode is essentially a min filter. This is a basic term in mathematical morphology – many operations are built on top of erode and the dilate operator.

list-card-cover-image

opening operator is defined as dilate(erode(img)). Intuitively, opening operation fills the white holes in the image.

list-card-cover-image

closing operator is defined as dilate(erode(img)). Intuitively, closing operation fills the black holes in the image.

list-card-cover-image

The (white) tophat operator is defined as img - opening(img). Intuitively, this filter can be used to extract small white elements and details from an image.

list-card-cover-image

The (black) tophat operator, also known as bottom hat, is defined as closing(img) - img. Intuitively, this filter can be used to extract small black elements and details from an image.

list-card-cover-image

There are three commonly used morphological gradient definitions: the beucher gradident dilate(img) - erode(img), the external half-gradient dilate(img) - img, and the internal half-gradident img - erode(img).

list-card-cover-image

Laplacian operator is defined as the difference between external gradient and internal gradient – mgradient(img; mode=:external) - mgradient(img; mode=:internal).

list-card-cover-image

The morphological reconstruction operator is to repeatedly apply particular operator until the stability, i.e,. output unchanged. The most widely used ones are reconstruction by dilation and reconstruction by erosion.

list-card-cover-image

underbuild is reconstruction by dilation, it is an alias for mreconstruct when op=dilate.

list-card-cover-image

overbuild is reconstruction by erosion, it is an alias for mreconstruct when op=erode.