| MIL 10 Reference
| Customize Help
| Save Settings

MimDistance



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 distance transformation.
Syntax
void MimDistance(
MIL_ID SrcImageBufId, //in
MIL_ID DstImageBufId, //in
MIL_INT64 DistanceTransform //in
)
Description

This function determines the shortest distance between each blob pixel and the blob's background, and assigns this distance to the pixel. It produces a type of contour mapping of a blob.

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 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, M_BGR32 packed, or floating-point.

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 buffer is always treated as unsigned.

DistanceTransform

Specifies the way in which the minimum distance from blob pixel to background pixel is calculated. This parameter approximates the true distance from blob pixel to background pixel using a 3x3 distance matrix and can be set to one of the following:

function map For specifying how to calculate the minimum distance
CollapseValue Description
Collapse M_CHAMFER_3_4

Determines the minimum distance using horizontal, vertical or diagonal pixel steps. Horizontal and vertical steps are counted as 3; diagonal steps are counted as 4. Then, the resulting distance is normalized by a factor of 3. This transform provides the best approximation to Euclidean distance.

This transform requires that the destination buffer be deep enough to hold a number at least three times the maximum distance from a blob pixel to its edge. For example, an 8-bit buffer (255 max) can be used for a maximum distance of 85 pixels and a 16-bit buffer (65535 max) for a maximum distance of 21845 pixels.

3x3 Distance Matrix:

(summarize)
Collapse M_CHESSBOARD

Determines the minimum distance using horizontal, vertical, or diagonal pixel steps. All steps count as 1.

3x3 Distance Matrix:

(summarize)
Collapse M_CITY_BLOCK

Determines the minimum distance using only horizontal or vertical pixel steps. Horizontal and vertical steps count as 1.

3x3 Distance Matrix:

(summarize)
Compilation information
Header Include mil.h.
Library Use mil.lib; milim.lib.
DLL Requires mil.dll; milim.dll.
PROC NONE PROC NONE CHAMFER 3 4 CHESSBOARD CITY BLOCK