MmeasGetResult()函数

Synopsis

Get the results of measurements taken.

Format

void MmeasGetResult(MarkerOrMeasResultId, ResultType, FirstResultPtr, SecondResultPtr)

MIL_ID MarkerOrMeasResultId; Marker buffer identifier or measurement result buffer identifier
long ResultType; Type of measurement for which to get results
void *FirstResultPtr; Storage location for the first result
void *SecondResultPtr; Storage location for the second result (if any)

Description

This function obtains the measurement result of a specified type from the specified buffer. Results should be obtained from a marker buffer if an MmeasFindMarker operation was performed and from a measurement result buffer if an MmeasCalculate operation was performed.

The MarkerOrMeasResultId parameter specifies the identifier of the marker buffer (allocated with MmeasAllocMarker) or measurement result buffer (allocated with MmeasAllocResult) in which results are stored.

The ResultType parameter specifies the type of result to obtain. FirstResultPtr and SecondResultPtr specify the addresses of the locations to which results will be written. For most result types, only the FirstResultPtr will be used and the SecondResultPtr should be set to M_NULL.

If results are being obtained from a marker buffer, the ResultType can be set to one of the values specified in the table below. To obtain results for a specific edge (either the first or second edge) of a stripe marker, add M_EDGE_FIRST or M_EDGE_SECOND to the ResultType. For example, M_LINE_EQUATION+M_EDGE_FIRST will return the line equation for the first edge of a stripe marker.

ResultType Description
M_VALID_FLAG The flag that denotes whether or not a marker was found (M_TRUE or M_FALSE).
M_SCORE The confidence score for the find marker operation (as a percentage).
M_POSITION The X and Y coordinates of the marker center in the image. The X coordinate is returned to the FirstResultPtr and the Y coordinate is returned to the SecondResultPtr.
M_POSITION_MIN The X and Y coordinates of the minimum position of an edge or stripe marker within the target image, relative to the top-left pixel in the image.
M_POSITION_MAX The X and Y coordinates of the maximum position of an edge or stripe marker within the target image, relative to the top-left pixel in the image.
M_POSITION_VARIATION The position variation of the marker in pixels (+/-).
M_ORIENTATION The orientation of the marker.
M_WIDTH The width of the marker in pixels.
M_WIDTH_VARIATION The width variation of the stripe marker in pixels.
M_LENGTH The length of the marker in pixels.
M_ANGLE The angle of the marker in degrees relative to the positive X axis. Returns a value between 0 and 360 degrees.
M_POLARITY The polarity of the marker (either M_NEGATIVE or M_POSITIVE). If the marker is an edge, the polarity is returned to the FirstResultPtr. If the marker is a stripe, the polarity of its first (from top-left) edge is returned to the FirstResultPtr and that of its second edge is returned to the SecondResultPtr.
M_CONTRAST The average grayscale difference between each edge composing a marker and its background. Returns one value for an edge marker; two for a stripe marker.
M_EDGE_STRENGTH The maximum pixel value variation (as a percentage of the buffer’s maximum possible value) of each edge of a marker. Returns one value for an edge marker, two for a stripe marker.
M_EDGE_INSIDE The number of edges located between the two exterior edges of a stripe marker.
M_EDGE_FIRST+… Information (…) concerning the first
exterior edge of a stripe.
(for example, M_EDGE_FIRST+M_ANGLE)
M_EDGE_SECOND+… Information (…) concerning the second exterior edge of a stripe. (for example, M_EDGE_SECOND+M_ANGLE)
M_BOX_EDGES_STRENGTH The maximum pixel value variation (as a percentage of the buffer’s maximum possible value) of each possible or actual edge marker found across the location box. Results are returned to FirstResultPtr as an array.
M_BOX_EDGES_STRENGTH_NUMBER The number of values to be returned by M_BOX_EDGES_STRENGTH.
M_BOX_CORNER_TOP_LEFT The X and Y positions of the top left corner of the location box.
M_BOX_CORNER_TOP_RIGHT The X and Y positions of the top right corner of the location box.
M_BOX_CORNER_BOTTOM_LEFT The X and Y positions of the bottom left corner of the location box.
M_BOX_CORNER_BOTTOM_RIGHT The X and Y positions of the bottom right corner of the location box.
M_LINE_EQUATION The equation of the mean line of the marker. The slope is returned to the FirstResultPtr and the Y intercept is returned to the SecondResultPtr.
M_LINE_EQUATION_SLOPE The slope of the line equation of the marker.
M_LINE_EQUATION_INTERCEPT The Y intercept of the line equation of the marker.

If results are being obtained from a measurement result buffer (MmeasCalculate) ,the ResultType can be:

ResultType Description
M_DISTANCE The distance, in pixels, between two markers.
M_DISTANCE_X The distance, in pixels, on the X axis between two markers.
M_DISTANCE_Y The distance, in pixels, on the Y axis between two markers.
M_ANGLE The angle in degrees of the line joining the two markers relative to the positive X axis. A value between 0 and 360 is returned.
M_LINE_EQUATION The equation of the line joining two markers. The slope is returned to the FirstResultPtr and the Y intercept is returned to the SecondResultPtr.
M_LINE_EQUATION_SLOPE The slope of the line equation joining two markers.
M_LINE_EQUATION_INTERCEPT The Y intercept of the line equation joining two markers.

When the equation of the line has an infinite slope, the value returned as the slope is M_INFINITE_SLOPE (1.0E+300).

Results are returned as type “double”. To have results returned as type “long”, combine the result type with M_TYPE_LONG (for example, M_VALID_FLAG+M_TYPE_LONG).

Note, M_INVALID is returned if a measurement was not calculated.

See also

MmeasFindMarker, MmeasCalculate, MmeasAllocMarker, MmeasAllocResult

《MmeasGetResult()函数》上有1条评论

评论已关闭。