Skip to main content

MbeadGetNeighbors

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

Get the template and/or vertex closest to a source point.

Syntax

void MbeadGetNeighbors(
AIL_ID ContextBeadId, //in
AIL_INT LabelOrIndex, //in
AIL_DOUBLE PositionX, //in
AIL_DOUBLE PositionY, //in
AIL_INT * TemplateLabelPtr, //out
AIL_INT * PointIndexPtr, //out
AIL_INT64 ControlFlag //in
)

Description

This function retrieves the label of the template, and the vertex within that template, that is closest to the specified position. This function can also retrieve the vertex within the specified template that is closest to the specified position. You can only use this function with templates whose path follows a polyline (MbeadControl with M_TRAINING_PATH set to either M_POLYLINE_SEED or M_POLYLINE).

To set a maximum distance for which Aurora Imaging Library considers a template or vertex to be the closest, use MbeadControl with M_CLOSEST_POINT_MAX_DISTANCE. By default, there is no maximum distance.

Parameters

ContextBeadId (in, AIL_ID)

Specifies the identifier of the bead context. The bead context must have been previously allocated on the required system using MbeadAlloc.

LabelOrIndex (in, AIL_INT)

Specifies the bead template in which the closest vertex is expected to be located.

For specifying a bead template

ValueDescription
M_NULLSpecifies no label or index value.

When using M_CLOSEST_TEMPLATE, LabelOrIndex must be set to M_NULL. | | M_TEMPLATE_INDEX | Specifies the index of the template. | | M_TEMPLATE_LABEL | Specifies the label of the template. |

PositionX (in, AIL_DOUBLE)

Specifies the source point's X-position.

PositionY (in, AIL_DOUBLE)

Specifies the source point's Y-position.

TemplateLabelPtr *(out, AIL_INT)

Specifies the address of the variable in which to write the label of the closest template.

PointIndexPtr *(out, AIL_INT)

Specifies the address of the variable in which to write the index of the closest vertex.

ControlFlag (in, AIL_INT64)

Specifies whether to retrieve the closest template and/or the closest vertex.

For specifying whether to receive the closest template or the closest vertex

ValueDescription
M_DEFAULTSame as M_CLOSEST_TEMPLATE.
M_CLOSEST_POINTSpecifies to return the vertex, within the specified template, that is closest to the specified source point.
M_CLOSEST_TEMPLATESpecifies to return the template, and the vertex within that template, that are closest to the specified source point.
Copyright © 2026 Zebra Technologies.