| MIL 10 Reference
| Customize Help
| Save Settings

MpatCopy



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

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
None.
Synopsis
Copy a pattern matching model to an image buffer.
Syntax
void MpatCopy(
MIL_ID ModelId, //in
MIL_ID DestImageBufId, //in
MIL_INT64 CopyMode //in
)
Description

This function copies the specified model to the specified destination image buffer, starting at the top-left corner of the buffer. Once the model is copied to the destination buffer, it can then be displayed (if the destination buffer is displayable).

By making two calls to this function, one in which M_DEFAULT is used as the copy mode and the other in which M_DONT_CARE is used, it is possible to achieve the effect of overlaying the "don't care" pixels onto the original model.

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 if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
ModelId

Specifies the identifier of the model that you want copied to the image buffer.

DestImageBufId

Specifies the identifier of the destination image buffer in which to place the model. You must ensure that the buffer is at least as large as the model. Note that the function only supports 8-bit unsigned grayscale images.

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.

CopyMode

Specifies how the model will be copied. This parameter must be set to one of the values below.

function map For specifying how to copy the model
CollapseValue Description
Collapse M_DEFAULT

Copies the portion of the source image from which the model was extracted to the destination buffer. That is, the model as it was first defined before any "don't care" pixels where associated with it (see MpatSetDontCare()). Overscan data is not copied.

(summarize)
Collapse M_DONT_CARE +

Copies only the "don't care" pixels of the model to the destination buffer. When copied, these pixels are given the value zero. To give these pixels a value other than zero, add the value to the M_DONT_CARE copy mode. Note, by default when using the M_DONT_CARE copy mode, any pixel value other than the "don't care" pixels in the destination image buffer will not be overwritten.

(summarize)
Combination constant for M_DONT_CARE.

You can add the following value to the above-mentioned value to set all pixels in the destination buffer that are not "don't care" pixels to zero.

function map For M_DONT_CARE to affect the destination buffer
CollapseCombination value Description
Collapse M_CLEAR_BACKGROUND

Clears pixels in the resulting destination buffer that are not "don't care" pixels to zero.

Example

The following example demonstrates how to copy "don't care" pixels as value 255 and set the other pixels in the destination buffer to zero.

MpatCopy(ModelId, ImageBufId, M_DONT_CARE +255 +M_CLEAR_BACKGROUND);
Compilation information
Header Include mil.h.
Library Use mil.lib; milpat.lib.
DLL Requires mil.dll; milpat.dll.
UNSIGNED PROC NONE DEFAULT DONT CARE CLEAR BACKGROUND