| MIL 10 Reference
| Customize Help
| Save Settings

MblobDraw



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
Synopsis
Draw specific blob features in the destination image buffer or graphics list.
Syntax
void MblobDraw(
MIL_ID ContextGraId, //in
MIL_ID ResultId, //in
MIL_ID DstImageBufOrListGraId, //in
MIL_INT64 Operation, //in
MIL_INT Label, //in
MIL_INT64 ControlFlag //in
)
Description

This function draws specific blob features, which were calculated with MblobCalculate(), in the destination image buffer or graphics list. This function can draw multiple features at a time.

You can draw results and settings, obtained relative to an offset, at the top-left corner of the destination image, using MgraControl() with M_DRAW_OFFSET_X and M_DRAW_OFFSET_Y and zoom them using MgraControl() with M_DRAW_ZOOM_X and M_DRAW_ZOOM_Y. For example, you can draw a zoomed section of the blobs found in the target image at the top-left corner of the destination image. For more information, see the Drawing graphics with offset and zoom subsection of the Drawing graphics section of Chapter 22: Generating graphics.

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
ContextGraId

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

function map For specifying the graphics context
CollapseValue Description
Collapse M_DEFAULT

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

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

(summarize)
Collapse MIL graphics context identifier

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

ResultId

Specifies the identifier of the blob analysis result buffer from which to retrieve the features to draw.

DstImageBufOrListGraId

Specifies the identifier of the destination image buffer or graphics list in which to draw. The buffer can be any valid MIL image buffer allocated using MbufAlloc...(). The graphics list must be previously allocated using MgraAllocList(). By drawing into a display's overlay buffer or associating the 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.

Operation

Specifies the type of operation to perform.

The values in the tables below can be added together to draw multiple features at a time. For example, to draw the contour, holes, and position of the blobs, you would specify M_DRAW_BLOBS_CONTOUR + M_DRAW_HOLES + M_DRAW_POSITION.

The following operations can draw in a destination image buffer or graphics list without restriction.

function map For specifying the type of operation
CollapseValue Description
Collapse M_DRAW_AXIS +

Draws a cross at the blobs' center of gravity, respecting the principal and secondary axes. Note that to perform this operation, one feature among M_AXIS_PRINCIPAL_ANGLE or M_AXIS_SECONDARY_ANGLE must have been calculated using the binary definition.

(summarize)
Collapse M_DRAW_BOX +

Draws the bounding box of each blob.

Note that to perform this operation, the M_BOX feature must have been calculated.

(summarize)
Collapse M_DRAW_BOX_CENTER +

Draws a cross at the center of the blobs' bounding box.

Note that to perform this operation, the M_BOX feature must have been calculated.

(summarize)
Collapse M_DRAW_CENTER_OF_GRAVITY +

Same as M_DRAW_POSITION.

Collapse M_DRAW_CONVEX_HULL +

Draws the convex hull of the blobs.

Note that to perform this operation, runs must have been previously saved using MblobControl() with M_SAVE_RUNS set to M_ENABLE.

(summarize)
Collapse M_DRAW_CONVEX_HULL_CONTOUR +

Draws the convex perimeter of the blobs.

Note that to perform this operation, runs must have been previously saved using MblobControl() with M_SAVE_RUNS set to M_ENABLE.

(summarize)
Collapse M_DRAW_FERET_MAX +

Draws the blobs' maximum Feret diameter, using an H-type line (|-|), centered at the blobs' position, at the maximum Feret diameter's angle.

Note that to perform this operation, the following features must have been calculated: M_BOX, M_FERET_MAX_DIAMETER, and M_FERET_MAX_ANGLE.

(summarize)
Collapse M_DRAW_FERET_MIN +

Draws the blobs' minimum Feret diameter, using an H-type line (|-|), centered at the blobs' position, at the minimum Feret diameter's angle.

Note that to perform this operation, the following features must have been calculated: M_BOX, M_FERET_MIN_DIAMETER, and M_FERET_MIN_ANGLE.

(summarize)
Collapse M_DRAW_MIN_AREA_BOX +

Draws the blobs' minimum-area bounding box.

Note that to perform this operation, at least one of the M_MIN_AREA_BOX features must have been calculated.

(summarize)
Collapse M_DRAW_MIN_PERIMETER_BOX +

Draws the blobs' minimum-perimeter bounding box.

Note that to perform this operation, at least one of the M_MIN_PERIMETER_BOX features must have been calculated.

(summarize)
Collapse M_DRAW_POSITION +

Draws a cross at the center of gravity of the blobs. Note that to perform this operation, M_CENTER_OF_GRAVITY must have been calculated using the binary definition.

(summarize)
Collapse M_DRAW_WORLD_BOX +

Draws the bounding box of each blob aligned with the relative coordinate system.

Note that to perform this operation, the M_WORLD_BOX feature must have been calculated.

(summarize)
Collapse M_DRAW_WORLD_BOX_CENTER +

Draws a cross at the center of the blobs' bounding box, calculated in the relative coordinate system.

Note that to perform this operation, the M_WORLD_BOX feature must have been calculated.

(summarize)
Collapse M_DRAW_WORLD_FERET_X +

Draws the blobs' Feret diameter, using an H-type line (|-|), centered at the blobs' position, parallel to the X-axis of the relative coordinate system.

Note that to perform this operation, the M_WORLD_FERET_X feature must have been calculated.

(summarize)
Collapse M_DRAW_WORLD_FERET_Y +

Draws the blobs' Feret diameter, using an H-type line (|-|), centered at the blobs' position, parallel to the Y-axis of the relative coordinate system.

Note that to perform this operation, the M_WORLD_FERET_Y feature must have been calculated.

(summarize)
Combination constants that can be used alone or as combination constants for the values listed in For specifying the type of operation.

You can use one or more of the following values in combination with each other or with the above-mentioned values, to specify operations that cannot be rendered in world units.

When drawing in either an image buffer or a graphics list, the following operations cannot be rendered in world units (MgraControl() with M_INPUT_UNITS must not be set to M_WORLD).

function map For specifying operations that cannot be rendered in world units
CollapseValue Description
Collapse M_DRAW_BLOBS

Draws the blobs. Note that to perform this operation, runs must have been previously saved using MblobControl() with M_SAVE_RUNS set to M_ENABLE.

(summarize)
Collapse M_DRAW_BLOBS_CONTOUR

Draws the external outline of the blobs.

Note that to perform this operation, runs must have been previously saved using MblobControl() with M_SAVE_RUNS set to M_ENABLE.

Also note that when using MblobControl() with M_BLOB_IDENTIFICATION set to either M_WHOLE_IMAGE or M_LABELED, both the blob and hole contours will be drawn when performing this operation. If M_BLOB_IDENTIFICATION is set to M_LABELED_TOUCHING, you cannot draw the external outlines of the blobs with M_DRAW_BLOBS_CONTOUR.

(summarize)
Collapse M_DRAW_HOLES

Draws the holes of the blobs.

Note that to perform this operation, runs must have been previously saved using MblobControl() with M_SAVE_RUNS set to M_ENABLE and one feature among M_BOX_X_MIN, M_BOX_X_MAX, M_BOX_Y_MIN, or M_BOX_Y_MAX must have been calculated.

(summarize)
Collapse M_DRAW_HOLES_CONTOUR

Draws the outline of the blobs' holes.

Note that to perform this operation, runs must have been previously saved using MblobControl() with M_SAVE_RUNS set to M_ENABLE.

Also note that when using MblobControl() with M_BLOB_IDENTIFICATION set to either M_WHOLE_IMAGE or M_LABELED, both the blob and hole contours will be drawn when performing this operation. If M_BLOB_IDENTIFICATION is set to M_LABELED_TOUCHING, you cannot draw the blobs' holes with M_DRAW_HOLES_CONTOUR.

(summarize)
Label

Specifies the label of the blob or blobs to draw.

This parameter should be set to one of the following:

function map For specifying the label of the blob or blobs to draw
CollapseValue Description
Collapse M_DEFAULT

Same as M_ALL_BLOBS.

Collapse M_ALL_BLOBS

Draws all blobs.

Collapse M_EXCLUDED_BLOBS

Draws all currently excluded blobs.

Collapse M_INCLUDED_BLOBS

Draws all currently included blobs.

Collapse Value

Draws the blob with the specified blob label value.

ControlFlag

Reserved for future expansion and must be set to M_DEFAULT.

Compilation information
Header Include mil.h.
Library Use mil.lib; milblob.lib.
DLL Requires mil.dll; milblob.dll.
DEFAULT PROC NONE DRAW AXIS DRAW BOX DRAW BOX CENTER DRAW CENTER OF GRAVITY DRAW CONVEX HULL DRAW CONVEX HULL CONTOUR DRAW FERET MAX DRAW FERET MIN DRAW MIN AREA BOX DRAW MIN PERIMETER BOX DRAW POSITION DRAW WORLD BOX DRAW WORLD BOX CENTER DRAW WORLD FERET X DRAW WORLD FERET Y DRAW BLOBS DRAW BLOBS CONTOUR DRAW HOLES DRAW HOLES CONTOUR DEFAULT ALL BLOBS EXCLUDED BLOBS INCLUDED BLOBS WORLD ENABLE