Search

Atalasoft Knowledge Base

INFO: MorphoDocumentCommand Mask Property

Administrator
DotImage

Missing Content Notice

This article originally had several images for examples. Unfortunately, they were lost in a migration from an older system to this platform.

The article has "img" placeholders where the originals used to be. We will endeavor to update with new examples soon.

Background

The MorphoDocumentCommand has a Mask property which has very sparse documentation:

Here is the extra info you need to know in order to make use of the mask

The Mask property contains so called “structuring element”, which is used by operations in mathematical morphology, a matrix basically.

During morphology operation, each pixel of input image is analyzed and is compared with the matrix:

  • In case of dilation it is compared with origin (center of the matrix). If both are set to 1, all neighbor pixels are set to 1 according to the structuring element matrix.
  • In case of erosion the pixel and its neighbor pixels are compared with the matrix and if all these pixels are set to 1 the same way as in the matrix, they are replaced with the single pixel (all neighbor pixels are set to 0).
  • Opening and closing operations are set of erosion and dilation or dilation and erosion operations correspondingly, so the meaning of the matrix is the same as above.

So, the size of the matrix affects the size of image objects in destination image - how thin they are after erosion operation, or how thick they are after dilation.


The structuring element matrix should have equal odd number of rows and columns, its size depends on user needs. MorphoDocumentCommand uses 3x3 matrix by default.

Examples

Here is result of processing with the command and structuring element matrix where all items are set to 1:

Original image sample

img

Dilation

Processing with matrix 3x3

1 1 1
1 1 1 
1 1 1

img

Processing with matrix 5x5

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

img

Erosion

Processing with matrix 3x3

1 1 1
1 1 1 
1 1 1

img

Processing with matrix 5x5

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

img

Original Article

Q10444 - INFO: MorphoDocumentCommand Mask Property

Last Update

2026-11-11 - TD - (Reformatted but could not find missing images)

Details
Last Modified: 13 hours ago
Last Modified By: Tananda
Type: INFO
Article not rated yet.
Article has been viewed 25 times.
Options
Also In This Category