MIL_ID ContextId, | //in |
MIL_ID Marker1Id, | //in |
MIL_ID Marker2Id, | //in |
MIL_ID MeasResultId, | //in |
MIL_INT64 MeasurementList | //in |
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(). MIL 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. MIL 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 MIL locates or returns the position of markers (MmeasFindMarker()).
If you specify multiple-occurrence markers, MIL performs its calculations using the occurrences of the first marker and the corresponding occurrences of the second marker. MIL limits the number of calculations to the smallest number of occurrences held in either marker. For example, if a marker contains one edge occurrence, MIL only performs one calculation, regardless of the number of edge occurrences in the other marker.
Specifies the measurement context to use.
For specifying the measurement
context
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default measurement context of the current MIL application. |
||||||||||||||||||||||||||||||||||||||
Measurement context ID |
Specifies a valid measurement context, allocated using MmeasAllocContext(). |
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
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_ANGLE + M_DISTANCE + M_LINE_EQUATION. |
||||||||||||||||||||||||||||||||||||||
M_ANGLE |
Calculates the angle of the line joining both markers, relative to the positive X-axis. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DISTANCE |
Calculates the distance of the line joining both markers. |
||||||||||||||||||||||||||||||||||||||
M_LINE_EQUATION |
Calculates the equation of the line joining both markers. |
Header | Include mil.h. |
Library | Use mil.lib; milmeas.lib. |
DLL | Requires mil.dll; milmeas.dll. |