| Customize Help
| Save Settings

MimDilate



Function Map
Synopsis
Perform a binary or grayscale dilation-type morphological operation.
Syntax
void MimDilate(
MIL_ID SrcImageBufId, //in
MIL_ID DstImageBufId, //in
MIL_INT NbIteration, //in
MIL_INT64 ProcMode //in
)
Description

This function performs a binary or grayscale dilation on the given source image for the specified number of iterations.

In binary mode, this function uses a 3x3 full rectangular structuring element; in grayscale mode, a 3x3 empty one.

The overscan pixels are automatically set to the lowest possible buffer value, which will produce the most accurate possible results for the image border pixels.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
SrcImageBufId

Specifies the identifier of the source image buffer.

This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.

DstImageBufId

Specifies the identifier of the destination image buffer.

This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.

NbIteration

Specifies the number of times to iterate the operation.

function map For specifying the number of iterations to perform
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies that each non-zero (white) blob should be dilated until its background is about to disappear. This value is only available when ProcMode is set to M_BINARY_ULTIMATE or M_BINARY_ULTIMATE_ACCUMULATE.

M_DEFAULT does not specify an explicit number of iterations to perform, instead it indicates to the function that the blobs should be dilated until black holes and the background are about to disappear. For example, if M_DEFAULT is specified and you have two rectangular blobs with two black holes (120x6 and 150x17), the dilation will continue until the black holes are reduced to 116x2 and 134x1, respectively (the smallest they can be before they disappear), and the background is reduced to the point it is about to disappear.

Setting NbIteration to M_DEFAULT with any processing mode other than M_BINARY_ULTIMATE or M_BINARY_ULTIMATE_ACCUMULATE will cause an error.

(summarize)
Click to summarize Value >= 0

Specifies the number of iterations.

When this parameter is set to 0 and ProcMode is set to M_BINARY, the source image is binarized and the result is copied into the destination image buffer.

When this parameter is set to 0 and ProcMode is set to M_GRAYSCALE, the source image is copied into the destination image buffer.

(summarize)
ProcMode

Specifies the processing mode to use. This parameter can be set to the following:

function map For specifying the processing mode
Click to summarizeValue Description
Click to summarize M_BINARY

Performs a binary dilation on the white (non-zero) blobs in the image. In this case, non-zero pixels are treated as ones (1) during processing.

The resulting non-zero pixels will have all bits set to one.

(summarize)
Click to summarize M_BINARY_ULTIMATE

Performs a binary dilation on the white (non-zero) blobs, while preventing the black (zero) holes and background from completely disappearing.

When in this processing mode, this operation performs a binary dilation until the number of iterations NbIteration is reached or until the black holes and background are about to disappear. If NbIteration is not set to M_DEFAULT, the specified number of iterations serves as an upper bound limit, and the procedure continues until the specified number of iterations is reached or the black holes and background are about to disappear, whichever comes first. If NbIteration is set to M_DEFAULT, the procedure continues until the black holes and background are about to disappear.

Note that if the dilation merges any blobs, the process continues on the merged blob. The holes and the background, however, are still evaluated individually.

(summarize)
Click to summarize M_BINARY_ULTIMATE_ACCUMULATE

Performs a binary erosion on the white (non-zero) blobs in the negative of the image, while preventing these blobs from completely disappearing and keeping track of the number of iterations.

Note that the negative of the image is taken and the operation is switched to an erosion, so that each remaining pixel in a hole or the background can track the number of iterations needed to reach the current state.

The resulting non-zero pixels will be set to the iteration number + 1. For example, consider an erosion with NbIteration set to 2. After the first iteration, the resulting non-zero pixels will be set to 1 + 1 (iteration number) = 2. After the second iteration,the resulting non-zero pixels will have all bits set to 1 + 2 (iteration number) = 3. This also means that what was considered the foreground is now considered the background, represented in black (zero), and what was considered holes and the background is now non-zero (iteration count).

When in this processing mode, this operation performs a binary erosion on the negative of the image until the number of iterations NbIteration is reached or until the blobs are about to disappear. If NbIteration is not set to M_DEFAULT, the specified number of iterations serves as an upper bound limit, and the procedure continues until the specified number of iterations is reached or until the blobs are about to disappear, whichever comes first. If NbIteration is set to M_DEFAULT, the procedure continues until the blobs are about to disappear.

Note that if the erosion splits any blobs, the process continues on each sub-blob, evaluating them separately.

For more information on binary ultimate accumulate dilation, see the Erosion and dilation section of Chapter 3: Fundamental image processing.

(summarize)
Click to summarize M_GRAYSCALE

Performs a grayscale dilation on the white (non-zero) blobs. In this case, each pixel of the source image is replaced with the maximum value in its neighborhood.

(summarize)
Compilation information
Header Include mil.h.
Library Use mil.lib; milim.lib.
DLL Requires mil.dll; milim.dll.
PROC NONE PROC NONE DEFAULT BINARY BINARY ULTIMATE BINARY ULTIMATE ACCUMULATE GRAYSCALE