| Customize Help
| Save Settings

MimErode



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

This function performs a binary or grayscale erosion 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 highest 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 blob should be eroded until it 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 each blob should be eroded until it is about to disappear. For example, if M_DEFAULT is specified and you have two rectangular blobs (120x6 and 150x17), the erosion will continue until the blobs are reduced to 116x2 and 134x1, respectively (the smallest they can be before they 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 erosion 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 erosion on the white (non-zero) blobs, while preventing them from completely disappearing.

When in this processing mode, this operation performs a binary erosion until the number of iterations NbIteration is reached or until the blob is 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 blob is about to disappear, whichever comes first. If NbIteration is set to M_DEFAULT, the procedure continues until the non-zero blob is about to disappear. Note that if the erosion splits any blobs, the process continues on each sub-blob evaluating them separately.

(summarize)
Click to summarize M_BINARY_ULTIMATE_ACCUMULATE

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

When in this processing mode, this operation performs a binary erosion until the number of iterations NbIteration is reached or until the blob is 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 blob is about to disappear, whichever comes first. If NbIteration is set to M_DEFAULT, the procedure continues until the non-zero blob is about to disappear.

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

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 be set to 1 + 2 (iteration number) = 3. For more information on erosion see the Erosion and dilation section of Chapter 3: Fundamental image processing.

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

(summarize)
Click to summarize M_GRAYSCALE

Performs a grayscale erosion on the white (non-zero) blobs in the image. In this case, each pixel of the source image is replaced with the minimum 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