| Customize Help
| Save Settings

MpatDraw



Function Map
Synopsis
Draw specific features of the model or result occurrence in an image buffer or 2D graphics list.
Syntax
void MpatDraw(
MIL_ID ContextGraId, //in
MIL_ID ContextOrResultPatId, //in
MIL_ID DstImageBufOrListGraId, //in
MIL_INT64 Operation, //in
MIL_INT Index, //in
MIL_INT64 ControlFlag //in
)
Description

This function draws specific model or result occurrence features in the destination image buffer or 2D graphics list. MpatDraw() can be used with multiple results.

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
ContextGraId

Specifies the identifier of the 2D graphics context to use. This parameter must be set to one of the following values:

function map For specifying the 2D graphics context
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies that the default 2D graphics context of the current MIL application is used.

Note that there is a different default 2D graphics context for each thread.

(summarize)
Click to summarize MIL 2D graphics context identifier

Specifies a valid 2D graphics context identifier, which you have allocated using MgraAlloc().

ContextOrResultPatId

Specifies the Pattern Matching context or result buffer identifier from which to extract the features to draw. The Pattern Matching context or result buffer must have been previously allocated using MpatAlloc() or MpatAllocResult(), respectively.

DstImageBufOrListGraId

Specifies the identifier of the destination image buffer or 2D graphics list into which to draw. The buffer can be any valid MIL image buffer allocated using MbufAlloc...(). The 2D graphics list must be previously allocated using MgraAllocList(). By drawing into a display's overlay buffer or associating the 2D graphics list with the display, you can also annotate an image non-destructively.

If specifying an image buffer, it must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.

When using MpatDraw() to draw features extracted from models or targets that are associated with a camera calibration context, the destination drawing buffer must also be calibrated to the same world coordinate system. MpatDraw() draws all the requested features according to whether the destination image buffer is physically corrected or not.

When drawing a model, the destination image must be at least the size of the model.

Operation

Specifies the type of operation to perform. Operations can be added together to draw multiple features at a time. For example, to draw both the result occurrence's bounding box and position, you would specify M_DRAW_BOX + M_DRAW_POSITION as the Operation parameter. The Operation parameter can be set to one or a combination of the values below.

The following operations can extract the features to draw from both a model and a result buffer.

function map For specifying an operation that can extract features from both a model and a result buffer
Click to summarizeValue Description
Click to summarize M_DRAW_BOX +

Draws the bounding box of the model or of the result occurrence(s). For a result occurrence, the box is drawn at the coordinates at which its origin was found in the target image (not the reference position), respecting the occurrence's angle.

(summarize)
Click to summarize M_DRAW_POSITION +

Draws a cross at the model's reference position, or at the result occurrence(s) position and angle found in the target image (with respect to the reference position).

Combination values that can be used alone or as combination values for the values listed in For specifying an operation that can extract features from both a model and a result buffer.

You can use one or more of the following values in combination with each other or with the above-mentioned values, to specify an operation that can extract features to draw only from a model.

The following operations can extract the features to draw only from a model and cannot draw in a 2D graphics list.

function map For specifying an operation that can extract features to draw only from a model
Click to summarizeValue Description
Click to summarize M_DRAW_DONT_CARE

Draws the model's don't care pixels.

Click to summarize M_DRAW_IMAGE

Draws the region of the model source image from which the model was extracted.

Index

Specifies whether to draw a specific result occurrence or model, or to draw all of them.

function map For specifying the index
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies the default value.

If a Pattern Matching context is specified, the default is 0.

If a Pattern Matching result buffer is provided, the default is the same as M_ALL.

(summarize)
Click to summarize M_ALL

Draws the specified feature of all models or all result occurrences.

Click to summarize Value >= 0

Specifies the model index or the result occurrence.

ControlFlag

Specifies where to draw a model. This parameter must be set to one of the values below.

function map For specifying where to draw the model
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies to draw the model starting from the center of the top-left pixel of the destination image; or, if drawing in a 2D graphics list, from the center of the top-left pixel of the image used at the time of annotation.

Click to summarize M_ORIGINAL

Specifies to draw the model starting from the offsets used to define the model in the model source image.

Compilation information
Header Include mil.h.
Library Use mil.lib; milpat.lib.
DLL Requires mil.dll; milpat.dll.
DEFAULT PROC NONE DRAW BOX DRAW POSITION DRAW DONT CARE DRAW IMAGE DEFAULT ALL DEFAULT ORIGINAL