| MIL 10 Reference
| Customize Help
| Save Settings

MimRank



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 rank filter on the pixels in an image.
Syntax
void MimRank(
MIL_ID SrcImageBufId, //in
MIL_ID DstImageBufId, //in
MIL_ID StructElemBufId, //in
MIL_INT Rank, //in
MIL_INT64 ProcMode //in
)
Description

This function performs a rank filter operation on the specified source buffer. It replaces each pixel with the pixel in its neighborhood whose value is the specified rankth value relative to others. It uses the specified structuring element as a mask. This mask determines the neighborhood size and which pixels in the neighborhood to ignore.

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 data source of the operation. This parameter must be given an image buffer identifier.

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 of the resulting image. This parameter must be given an image buffer identifier.

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.

StructElemBufId

Specifies the identifier of the structuring element buffer to use as a mask. You can either define a custom structuring element as a mask or use a predefined mask buffer.

function map For the structuring element buffer
CollapseValue Description
MIL system-specific
tooltip (†)
Collapse M_3X3_CROSS +

Applies a cross (+) mask and sets the neighborhood size to 3x3 pixels. In this case, there are 5 valid neighborhood pixels; the cross mask makes the function ignore the pixels located at the four corners of the neighborhood.

(summarize)
a b c d e f g h i j k l m n o p q r s
Collapse M_3X3_RECT +

Applies no mask and sets the neighborhood size to 3x3 pixels. In this case, there are 9 valid neighborhood pixels.

(summarize)
a b c d e f g h i j k l m n o p q r s
Collapse M_5X5_RECT +

Applies no mask and sets the neighborhood size to 5x5 pixels. In this case, there are 25 valid neighborhood pixels.

(summarize)
a b c d e f g h i j k l m n o p q r s
Collapse MIL structuring element buffer identifier +

Applies a mask specified by the custom structuring element, having been previously allocated with MbufAlloc...() with an M_STRUCT_ELEMENT attribute. This structuring element is to be loaded with structuring-element values, using MbufPut(). The structuring element buffer dimensions are used as the neighborhood size. Values in the structuring element set to M_DONT_CARE represent neighborhood pixels not to be considered in the ranking operation. All other values in the structuring element must be set to 1, representing neighborhood pixels to be considered in the ranking operation.

(summarize)
a b c e f g h i j k l m n o p q r s
Combination constants for any of the possible values of the StructElemBufId parameter.

You can add one of the following values to the above-mentioned values to specify that overscanning is temporarily disabled.

function map For temporarily disabling overscanning
CollapseCombination value Description
MIL system-specific
tooltip (†)
Collapse M_OVERSCAN_DISABLE

Disables overscanning temporarily. You should disable overscanning to accelerate the operation for applications in which the overscan data is not important in the resulting buffer.

(summarize)
a b c e f g h i j k l m n o p q r s
Collapse M_OVERSCAN_FAST

Specifies that MIL will automatically select the overscan that optimizes speed, according to the specified operation and the target system. The overscan could be hardware-specific thereby having a different behavior than the other supported overscan modes.

Note that when using M_OVERSCAN_FAST, the destination pixels in the overscan area are undefined. The pixels can therefore contain different values from one function call to the next, even if the function's parameter values are the same.

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

Specifies which of the pixel values to select after valid neighborhood values are sorted in increasing order; valid neighborhood pixel values are those that are not masked-out.

function map For specifying which pixel to select
CollapseValue Description
Collapse M_MEDIAN

Specifies that MimRank() performs a median filter (that is, each pixel is replaced with the median neighborhood value).

Collapse 1 <= Value <= number of valid neighborhood
pixels

Specifies the rank of the pixel value to select. If the number of valid pixels is less than the given rank, the number of valid pixels is used as the rank.

(summarize)
ProcMode

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

function map For specifying the processing mode to use
CollapseValue Description
Collapse M_BINARY

Treats non-zero pixels as ones (1) during processing. The resulting non-zero pixels will have all bits set to one.

(summarize)
Collapse M_GRAYSCALE

Uses the source image's gray values for processing. The resulting buffer will also contain gray values.

This is the default value.

(summarize)
Compilation information
Header Include mil.h.
Library Use mil.lib; milim.lib.
DLL Requires mil.dll; milim.dll.
PROC NONE PROC NONE 3X3 CROSS 3X3 RECT 5X5 RECT OVERSCAN DISABLE OVERSCAN FAST MEDIAN BINARY GRAYSCALE