Skip to main content

MmeasCalculate

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

Calculate measurements between two markers.

Syntax

void MmeasCalculate(
AIL_ID ContextId, //in
AIL_ID Marker1Id, //in
AIL_ID Marker2Id, //in
AIL_ID MeasResultId, //out
AIL_INT64 MeasurementList //in
)

Description

This function calculates the specified measurements between the two specified markers. Before using an edge, stripe, or circle marker with this function, it must have been previously found in a target image (MmeasFindMarker). Before using a point marker, its position must have been previously set (MmeasSetMarker).

The settings of the specified measurement context control the behavior of this function; to adjust these settings, use MmeasControl. Aurora Imaging Library stores the results of an MmeasCalculate operation in the specified measurement result buffer; to obtain the results, use MmeasGetResult or MmeasGetResultSingle. If the markers were found in a calibrated image, you can specify the output units using MmeasControl with M_RESULT_OUTPUT_UNITS. Aurora Imaging Library calculates the specified measurements according to the line joining the reference position of each marker (Marker1Id and Marker2Id).

For edge, stripe, and circle markers, the default reference position corresponds to the marker's found position. For an edge marker, the default reference position is the X- and Y-coordinates of the edge's maximum edgevalue. For a stripe marker, the default reference position is the center of the center line that is fit between the stripe's two outer edges. For a circle marker, the default reference position is the X- and Y-coordinates of the circle's center. For a point marker, the default reference position is the same as the position specified using MmeasSetMarker with M_POSITION.

To change the reference position of any marker, use MmeasSetMarker with M_MARKER_REFERENCE. Modifying the reference position only affects calculations between two markers (MmeasCalculate); it does not, for example, affect how Aurora Imaging Library locates or returns the position of markers (MmeasFindMarker).

If you specify multiple-occurrence markers, Aurora Imaging Library performs its calculations using the occurrences of the first marker and the corresponding occurrences of the second marker. Aurora Imaging Library limits the number of calculations to the smallest number of occurrences held in either marker. For example, if a marker contains one edge occurrence, Aurora Imaging Library only performs one calculation, regardless of the number of edge occurrences in the other marker.

Parameters

ContextId (in, AIL_ID)

Specifies the measurement context to use.

For specifying the measurement context

ValueDescription
M_DEFAULTSpecifies the default measurement context of the current Aurora Imaging Library application.
Measurement context IDSpecifies a valid measurement context, allocated using MmeasAllocContext.

Marker1Id (in, AIL_ID)

Specifies the identifier of the first marker buffer to use for calculating measurements.

Marker2Id (in, AIL_ID)

Specifies the identifier of the second marker buffer to use for calculating measurements.

MeasResultId (out, AIL_ID)

Specifies the identifier of the result buffer in which to place results.

MeasurementList (in, AIL_INT64)

Specifies which measurement(s) to calculate. This parameter must be set to one of the following values. To calculate more than one measurement, add the values together (for example, M_DISTANCE+M_ANGLE).

For specifying which measurement(s) to calculate

ValueDescription
M_DEFAULTSame as M_ANGLE + M_DISTANCE + M_LINE_EQUATION.
M_ANGLECalculates the angle of the line joining both markers, relative to the positive X-axis. The resulting angle can be any value between 0° and 360°.
M_DISTANCECalculates the distance of the line joining both markers.
M_LINE_EQUATIONCalculates the equation of the line joining both markers.
Copyright © 2026 Zebra Technologies.