Skip to main content

MblobDraw

BoardSupported
Host SystemYes
V4L2Yes
Clarity UHDYes
Concord PoENo
GenTLYes
GevIQYes
GigE VisionYes
IndioNo
Iris GTXYes
Radient eV-CLYes
Rapixo CLYes
Rapixo CoFYes
Rapixo CXPYes
USB3 VisionYes

Draw specific blob features in the destination image buffer or 2D graphics list.

Syntax

void MblobDraw(
AIL_ID ContextGraId, //in
AIL_ID ResultBlobId, //in
AIL_ID DstImageBufOrListGraId, //out
AIL_INT64 Operation, //in
AIL_INT LabelOrIndex, //in
AIL_INT64 ControlFlag //in
)

Description

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

You can draw results 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 withM_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 Drawing with an offset and scale.

[Image: DrawBlob.png]

Parameters

ContextGraId (in, AIL_ID)

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

For specifying the 2D graphics context

ValueDescription
M_DEFAULTSpecifies that the default 2D graphics context of the current Aurora Imaging Library application is used.

Note: Note that there is a different default 2D graphics context for each thread. | | 2D graphics context identifier | Specifies a valid 2D graphics context identifier, which you have allocated using MgraAlloc. |

ResultBlobId (in, AIL_ID)

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

DstImageBufOrListGraId (out, AIL_ID)

Specifies the identifier of the destination image buffer or 2D graphics list in which to draw. The buffer can be any valid 1- or 3-band 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.

Operation (in, AIL_INT64)

Specifies the type of operation to perform.

For specifying the type of operation

ValueDescription
M_DRAW_AXISDraws 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.
M_DRAW_BLOBSDraws the blobs. Note that to perform this operation, runs must have been previously saved using MblobControl with M_SAVE_RUNS set to M_ENABLE.
M_DRAW_BLOBS_CONTOURDraws 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_MODE 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_MODE is set to M_LABELED_TOUCHING, you cannot specify M_DRAW_BLOBS_CONTOUR. | | M_DRAW_BOX | Draws the image-axis aligned bounding box of each blob. The image-axis-aligned bounding box is the bounding box that is aligned with the pixel coordinate system's axes. | | M_DRAW_BOX_CENTER | Draws a cross at the center of the blobs' bounding box. | | M_DRAW_CENTER_OF_GRAVITY | Same as M_DRAW_POSITION. | | M_DRAW_CONVEX_HULL | Draws the convex hull of the blobs. | | M_DRAW_CONVEX_HULL_CONTOUR | Draws the convex perimeter of the blobs. | | M_DRAW_FERET_MAX | Draws the blobs' maximum Feret diameter, using an H-type line (|-|) that passes through the center of the blob's bounding box at the maximum Feret diameter's angle. The line's end points are tangent to the Feret diameter's contact points.

[Image: Blob_feret_maximum.png]

Note that to perform this operation, the following features must have been calculated: M_BOX, M_FERET_MAX_DIAMETER, and M_FERET_MAX_ANGLE. | | M_DRAW_FERET_MIN | Draws the blobs' minimum Feret diameter, using an H-type line (|-|) that passes through the center of the blob's bounding box at the minimum Feret diameter's angle. The line's end points are tangent to the Feret diameter's contact points.

[Image: Blob_feret_minimum.png]

Note that to perform this operation, the following features must have been calculated: M_BOX, M_FERET_MIN_DIAMETER, and M_FERET_MIN_ANGLE. | | 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. | | 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_MODE 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_MODE is set to M_LABELED_TOUCHING, you cannot draw the blobs' holes with M_DRAW_HOLES_CONTOUR. | | 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. | | 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. | | 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. | | M_DRAW_WORLD_BOX | Draws the world-axis aligned bounding box of each blob. The world-axis-aligned bounding box is the bounding box that is aligned with the relative coordinate system's axes.

Note that to perform this operation, the M_WORLD_BOX features must have been calculated. | | 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 features must have been calculated. | | 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. | | 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. |

LabelOrIndex (in, AIL_INT)

Specifies the label or index of the blob or blobs whose information to draw.

For specifying the label of the blob or blobs to draw

ValueDescription
M_DEFAULTSame as M_ALL_BLOBS.
M_BLOB_INDEXSpecifies the index of the blob.
M_BLOB_LABELSpecifies the label of the blob for which to get results. You can get a list of valid blob label values with M_LABEL_VALUE.
M_ALL_BLOBSSpecifies all blobs.
M_EXCLUDED_BLOBSSpecifies all currently excluded blobs.
M_INCLUDED_BLOBSSpecifies all currently included blobs.

ControlFlag (in, AIL_INT64)

Reserved for future expansion and must be set to M_DEFAULT.

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

Note that to perform this operation, the M_CONVEX_HULL feature must have been calculated, and runs must have been previously saved using MblobControl with M_SAVE_RUNS set to M_ENABLE.

When drawing in either an image buffer or a 2D graphics list, MgraControl with M_INPUT_UNITS cannot be set to M_WORLD for this operation.

Copyright © 2026 Zebra Technologies.