Skip to main content

MimBoundingBox

Compute the bounding box that contains valid pixels according to a given condition.

Syntax

void MimBoundingBox(
AIL_ID SrcImageBufId, //in
AIL_INT64 Condition, //in
AIL_DOUBLE CondLow, //in
AIL_DOUBLE CondHigh, //in
AIL_INT64 BoxDefinitionType, //in
AIL_INT * TopLeftXPtr, //out
AIL_INT * TopLeftYPtr, //out
AIL_INT * BottomRightXOrLengthPtr, //out
AIL_INT * BottomRightYOrLengthPtr, //out
AIL_INT64 ControlFlag //in
)

Description

This function computes the bounding box that contains valid pixels according to a given condition, based on a lower limit and an upper limit. For example, you can define a condition such that pixels are valid only within a specified value range.

You can specify to return the bounding box in one of two ways: using coordinates of 2 opposite corners, or using coordinates of 1 corner and the width and height (in pixel units).

You can limit this function's results to a region of the source image buffer using a region of interest (ROI) set using MbufSetRegion.

Parameters

SrcImageBufId (in, AIL_ID)

Specifies the identifier of the data source of the operation. This parameter must be set to the Aurora Imaging Library identifier of a 1-band image buffer.

Condition (in, AIL_INT64)

Specifies the condition under which pixels are considered valid.

For specifying the condition

ValueDescription
M_EQUALSpecifies that only pixels with values equal to CondLow are considered valid. CondHigh must be set to 0.
M_GREATERSpecifies that only pixels with values greater than CondLow are considered valid. CondHigh must be set to 0.
M_GREATER_OR_EQUALSpecifies that only pixels with values greater than or equal to CondLow are considered valid. CondHigh must be set to 0.
M_IN_RANGESpecifies that pixel values between CondLow and CondHigh, inclusive, are considered valid.
M_LESSSpecifies that only pixels with values less than CondHigh are considered valid. CondLow must be set to 0.
M_LESS_OR_EQUALSpecifies that only pixels with values less than or equal to CondHigh are considered valid. CondLow must be set to 0.
M_NOT_EQUALSpecifies that only pixels with values not equal to CondLow are considered valid. CondHigh must be set to 0.
M_OUT_RANGESpecifies that pixels with values less than CondLow, or greater than CondHigh, are considered valid.

CondLow (in, AIL_DOUBLE)

Specifies the lower limit of the selected condition.

CondHigh (in, AIL_DOUBLE)

Specifies the upper limit of the selected condition.

BoxDefinitionType (in, AIL_INT64)

Specifies the way in which the bounding box is returned.

For specifying the way in which the bounding box is returned

ValueDescription
M_BOTH_CORNERSSpecifies to return the bounding box using the coordinates of its top-left and bottom-right corners.
M_CORNER_AND_DIMENSIONSpecifies to return the bounding box using the coordinates of its top-left corner, and the box's width and height.

TopLeftXPtr *(out, AIL_INT)

Specifies the address of the variable in which to write the X-coordinate of the top-left corner of the bounding box.

TopLeftYPtr *(out, AIL_INT)

Specifies the address of the variable in which to write the Y-coordinate of the top-left corner of the bounding box.

BottomRightXOrLengthPtr *(out, AIL_INT)

Specifies the address of the variable in which to write the X-coordinate of the bottom-right corner or the width of the bounding box.

BottomRightYOrLengthPtr *(out, AIL_INT)

Specifies the address of the variable in which to write the Y-coordinate of the bottom-right corner or the height of the bounding box.

ControlFlag (in, AIL_INT64)

Reserved for future expansion and must be set to M_DEFAULT.

Copyright © 2026 Zebra Technologies.