| Customize Help
| Save Settings

MmetPut



Function Map
Synopsis
Put edgels or points from user-supplied arrays into a constructed edgel feature built with external edgels/points.
Syntax
void MmetPut(
MIL_ID ContextMetId, //in
MIL_INT LabelOrIndex, //in
MIL_INT NumEdgelsOrPoints, //in
const MIL_INT *ChainIndexArrayPtr, //in
const MIL_DOUBLE *PosXArrayPtr, //in
const MIL_DOUBLE *PosYArrayPtr, //in
const MIL_DOUBLE *AngleArrayPtr, //in
const MIL_DOUBLE *ValueArrayPtr, //in
MIL_INT64 ControlFlag //in
)
Description

This function adds edgels or points from user-supplied arrays to a constructed edgel feature built with external edgels/points. You can add a constructed edgel feature built with external edgels/points to the metrology context using MmetAddFeature() with M_EDGEL and M_EXTERNAL_FEATURE. Every time MmetPut() is called, it adds the specified edgels/points to the constructed feature, without overwriting previously-added edgels/points with the same position. Points and edgels can be added to the same feature, but you must use separate calls.

MmetPut() is useful if you want to construct an edgel feature with edgels established using the Edge Finder module or with the coordinates of chained pixels (points) established using the Blob Analysis module. You can also, for example, use MmetPut() to add points from a cross-section of a 3D scanned object, delimited by an extraction box, so that you can analyze the profile of the cross-section. To inquire information about an external edgel feature (M_EXTERNAL_FEATURE), such as the total number of external points/edgels it contains (M_NUMBER), call MmetInquire().

Information about a particular edgel/point must occupy the same index in each array. You specify points by specifying their position (X- and Y-position arrays). You specify edgels by specifying their position and their gradient angle (edgel direction). An edgel's angle must respect the convention:

  • The angle is measured between the target image's horizontal axis and the edge's gradient (the direction of the edgel's most sudden change from black to white).

  • The angle is measured counter-clockwise.

  • You must map the angle to an 8-bit range; that is, 0° corresponds to 0, and 360° corresponds to 256.

A point/edgel's position must be relative to the reference frame of the constructed edgel feature (MmetControl() with M_REFERENCE_FRAME), which can be set to either the global frame or a local frame.

When passing points that are along an edge, but you don't have their gradient angle information (as is the case when obtained using the Blob Analysis module), you can have MmetPut() automatically calculate their approximate gradient angle by passing M_INTERPOLATE_ANGLE to the ControlFlag parameter. MmetPut() interpolates their gradient angles assuming that points in the arrays are consecutive. As such, the points in the X- and Y-position arrays must be an ordered, connected chain of points. Note that if the points are not from an edge, you should not pass M_INTERPOLATE_ANGLE.

Consecutive edgels in the arrays are considered to be consecutive in their associated edge.

For edgels or points along an edge, you can associate the edgels/points with the index of their edge chain/pixel chain using the ChainIndexArrayPtr parameter. You can add to the end of an edge chain/pixel chain that has already been added to the feature.

To remove all the edgels/points from the constructed edgel feature, set the ControlFlag parameter to M_RESET.

Note, if a camera calibration context is associated with the expected target image, set values in real-world units (for example, positional values). Otherwise, use pixel units.

Note that when using a C compiler (not a C++ or other compiler), it is suggested to use the type-specific versions of this particular function, rather than the standard function prototype at the top of this page. An exhaustive list of type-specific versions of this function can be found at the bottom of this page.
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 which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
ContextMetId

Specifies the identifier of the metrology context. The metrology context must have been previously allocated with MmetAlloc().

LabelOrIndex

Specifies the label or index of a constructed edgel feature with an M_EXTERNAL_FEATURE build operation.

NumEdgelsOrPoints

Specifies the number of edgels/points to add to the constructed edgel feature.

When using a standard vector (std::vector) overload function in C++, you can pass M_DEFAULT to this parameter and MIL will automatically determine the size based on the number of items in the vector passed to the PosXArrayPtr, PosYArrayPtr, or AngleArrayPtr parameter.

ChainIndexArrayPtr
Accepts the address of one of the following:
  • array of type MIL_INT [optionally, in C++: a reference to a constant std::vector<MIL_INT> ] (and a maximum array rank for C# of 1)
    Required array size:(NumEdgelsOrPoints)

Specifies the address of the array containing the index of the edge chain/pixel chain to which an edgel/point belongs. If specifying edgels/points from several separate chains, this index array identifies the connected edgels/points that are part of the same chain. The order of the edgels in the array determines the shape of the chain. This is especially useful if the gradient angle is not provided, and MmetPut() is interpolating the angle value. If unused, set this parameter to M_NULL.

PosXArrayPtr INQ
Accepts the address of one of the following:
  • array of type MIL_DOUBLE [optionally, in C++: a reference to a constant std::vector<MIL_DOUBLE> ] (and a maximum array rank for C# of 1)
    Required array size:(NumEdgelsOrPoints)

Specifies the address of the array containing the X-coordinates of the edgels/points. To remove all the edgels/points in the feature, set this parameter to M_NULL.

PosYArrayPtr INQ
Accepts the address of one of the following:
  • array of type MIL_DOUBLE [optionally, in C++: a reference to a constant std::vector<MIL_DOUBLE> ] (and a maximum array rank for C# of 1)
    Required array size:(NumEdgelsOrPoints)

Specifies the address of the array containing the Y-coordinates of the edgels/points. To remove all the edgels/points in the feature, set this parameter to M_NULL.

AngleArrayPtr INQ
Accepts the address of one of the following:
  • array of type MIL_DOUBLE [optionally, in C++: a reference to a constant std::vector<MIL_DOUBLE> ] (and a maximum array rank for C# of 1)
    Required array size:(NumEdgelsOrPoints)

Specifies the address of the array containing the gradient angle (orientation) of the edgels. If adding points instead of edgels, or removing the edgels/points in the feature, set this parameter to M_NULL.

Angle values must be mapped in the range of 0 to 255. That is, 0° corresponds to 0, and 360° corresponds to 256.

ValueArrayPtr
Accepts the address of one of the following:
  • array of type MIL_DOUBLE [optionally, in C++: a reference to a constant std::vector<MIL_DOUBLE> ] (and a maximum array rank for C# of 1)
    Required array size:(NumEdgelsOrPoints)

Reserved for future expansion and must be set to M_NULL.

ControlFlag

Specifies whether to automatically calculate the expected gradient angle of the edge at the specified points, when a gradient angle array has not been specified. This parameter must be set to one of the following values:

function map To specify the function's control flag
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies to ignore this parameter, or in the case when points are passed, not to calculate the gradient angle.

Click to summarize M_INTERPOLATE_ANGLE

Specifies to determine the expected gradient angle of the edge at the specified points. This assumes that the specified points are a connected chain of points. Angles are calculated based on interpolation of consecutive points. This can be useful when limiting the angular range for fitted features.

(summarize)
Click to summarize M_RESET

Specifies to remove all the edgels/points from the specified constructed edgel feature. In this case, the NumEdgelsOrPoints parameter must be set to 0, and the array parameters to M_NULL.

(summarize)
Type-specific versions of the function when using a C compiler
void MmetPutDouble (MIL_ID ContextMetId, MIL_INT LabelOrIndex, MIL_INT NumEdgelsOrPoints, const MIL_INT *ChainIndexArrayPtr, const MIL_DOUBLE *PosXArrayPtr, const MIL_DOUBLE *PosYArrayPtr, const MIL_DOUBLE *AngleArrayPtr, const MIL_DOUBLE *ValueArrayPtr, MIL_INT64 ControlFlag)
Parameters

ContextMetId

See ContextMetId of the main function for a description.

LabelOrIndex

See LabelOrIndex of the main function for a description.

NumEdgelsOrPoints

See NumEdgelsOrPoints of the main function for a description.

ChainIndexArrayPtr

See ChainIndexArrayPtr of the main function for a description.

PosXArrayPtr

See PosXArrayPtr of the main function for a description.

PosYArrayPtr

See PosYArrayPtr of the main function for a description.

AngleArrayPtr

See AngleArrayPtr of the main function for a description.

ValueArrayPtr

See ValueArrayPtr of the main function for a description.

ControlFlag

See ControlFlag of the main function for a description.

void MmetPutFloat (MIL_ID ContextMetId, MIL_INT LabelOrIndex, MIL_INT NumEdgelsOrPoints, const MIL_INT *ChainIndexArrayPtr, const MIL_FLOAT *PosXArrayPtr, const MIL_FLOAT *PosYArrayPtr, const MIL_FLOAT *AngleArrayPtr, const MIL_FLOAT *ValueArrayPtr, MIL_INT64 ControlFlag)
Parameters

ContextMetId

See ContextMetId of the main function for a description.

LabelOrIndex

See LabelOrIndex of the main function for a description.

NumEdgelsOrPoints

See NumEdgelsOrPoints of the main function for a description.

ChainIndexArrayPtr

See ChainIndexArrayPtr of the main function for a description.

PosXArrayPtr

See PosXArrayPtr of the main function for a description.

PosYArrayPtr

See PosYArrayPtr of the main function for a description.

AngleArrayPtr

See AngleArrayPtr of the main function for a description.

ValueArrayPtr

See ValueArrayPtr of the main function for a description.

ControlFlag

See ControlFlag of the main function for a description.

Compilation information
Header Include mil.h.
Library Use mil.lib; milmetrol.lib.
DLL Requires mil.dll; milmetrol.dll.
DEFAULT INTERPOLATE ANGLE RESET