| Customize Help
| Save Settings

MimRank



Function Map
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.

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.

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
Click to summarizeValue Description MIL system-specific
tooltip (‡)
Click to summarize 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 c
M10
g h i j k
M10
l m o p r
U27
t
U28
u
U36
v y
U75
aa
Click to summarize 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 c
M10
g h i j k
M10
l m o p r
U27
t
U28
u
U36
v y
U75
aa
Click to summarize 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 c
M10
g h i j k
M10
l m o p r
U27
t
U28
u
U36
v y
U75
aa
Click to summarize 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 c
M10
g h i j k
M10
l m o p r
U27
t
U28
u
U36
v y
U75
aa
Combination values for M_3X3_CROSS; M_3X3_RECT; M_5X5_RECT.

You can add one of the following values to the above-mentioned values to specify the overscan settings to use for the operation.

function map For specifying the overscan setting
Click to summarizeCombination value Description MIL system-specific
tooltip (‡)
Click to summarize M_OVERSCAN_DISABLE

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

(summarize)
a c
M10
g h i j k
M10
l m o p r
U27
t
U28
u
U36
v y
U75
aa
Click to summarize M_OVERSCAN_ENABLE

Specifies to enable overscanning for this operation. The overscan uses pixels from the ancestor of the source buffer. If the source buffer is not a child buffer, or if the point falls outside the ancestor buffer, a mirror type overscan is used. A mirror overscan specifies that the overscan pixels will be a mirror copy of the source buffer's border pixels.

This is the default value.

(summarize)
a c
M10
g h i j k
M10
l m o p r
U27
t
U28
u
U36
v y
U75
aa
Click to summarize 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 c
M10
g h i j k
M10
l m o p r
U27
t
U28
u
U36
v y
U75
aa
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
Click to summarizeValue Description
Click to summarize M_MEDIAN

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

Click to summarize 0 < 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
Click to summarizeValue Description
Click to summarize M_BINARY

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

(summarize)
Click to summarize M_GRAYSCALE

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

(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 ENABLE OVERSCAN FAST MEDIAN BINARY GRAYSCALE