| MIL 10 Reference
| Customize Help
| Save Settings

MimErode



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Partially supported on:
Partially supported on Matrox GPU processing driver

Fully supported on:
Fully supported on Host system
Fully supported on Matrox CronosPlus
Fully supported on Matrox GigE Vision driver
Fully supported on Matrox IEEE 1394 IIDC driver
Fully supported on Matrox Iris GT
Fully supported on Matrox Morphis
Fully supported on Matrox Morphis QxT
Fully supported on Matrox Orion HD
Fully supported on Matrox Radient eCL
Fully supported on Matrox Radient eV-CXP
Fully supported on Matrox Solios eA/XA
Fully supported on Matrox Solios ecl/xcl/ev-cl
Fully supported on Matrox USB3 Vision driver (requires Update 19)
Fully supported on Matrox Vio

For any information regarding a MIL system added during a MIL Update, see the MIL system’s release note

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
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.

[Matrox GPU processing driver]

The source image buffer must be unsigned monochrome 8- or 16-bit.

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.

[Matrox GPU processing driver]

The destination image buffer must be unsigned monochrome 8- or 16-bit.

NbIteration

Specifies the number of times to iterate the operation.

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.

When ProcMode is set to M_BINARY_ULTIMATE, this parameter can be set to M_DEFAULT. M_DEFAULT does not specifiy 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 150x16), the erosion will continue until the blobs are reduced to 116x2 and 136x2 respectively (the smallest they can be before the disappear).

Setting NbIteration to M_DEFAULT with any processing mode other than M_BINARY_ULTIMATE will cause an error, that is, M_DEFAULT can only be applied when ProcMode is set to M_BINARY_ULTIMATE.

ProcMode

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

function map For specifying the processing mode
CollapseValue Description
MIL system-specific
tooltip (†)
Collapse M_BINARY

Performs a binary erosion. 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)
a b c d e f g h i j k l m n o p q r s
MIL system specific

Both the source and destination buffers must be packed binary.

d
Collapse M_BINARY_ULTIMATE

Performs a binary erosion on white (non-zero) blobs. 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. Note that if the erosion splits any blobs, the process continues on each sub-blob.

(summarize)
a b c d e f g h i j k l m n o p q r s
MIL system specific

Both the source and destination buffers must be packed binary.

d
Collapse M_GRAYSCALE

Performs a grayscale erosion. In this case, each pixel of the source image is replaced with the minimum value in its neighborhood.

(summarize)
a b c d e f g h i j k l m n o p q r s
Compilation information
Header Include mil.h.
Library Use mil.lib; milim.lib.
DLL Requires mil.dll; milim.dll.
PROC NONE PROC NONE BINARY BINARY ULTIMATE GRAYSCALE DEFAULT