Synopsis
Allocate a measurement marker.
Format
MIL_ID MmeasAllocMarker(SystemId, MarkerType, ControlFlag, MarkerIdPtr)
MIL_ID SystemId; | System identifier |
long MarkerType; | Type of marker |
long ControlFlag; | Allocation control flag |
MIL_ID *MarkerIdPtr | Storage location for marker identifier |
Description
This function allocates a measurement marker on the specified system. Once allocated, a marker’s characteristics can be specified, using MmeasSetMarker. These characteristics are used as the criteria for finding the marker in a target image. A marker can be located in a target image and its measurements taken, using MmeasFindMarker, or it can be used as a reference position in calculations involving two markers (MmeasCalculate). When the marker buffer is no longer required, release its memory, using MmeasFree.
The SystemId parameter specifies the system on which the marker will be allocated. This parameter must be set to a valid system identifier, M_DEFAULT_HOST, or M_DEFAULT. Specify M_DEFAULT_HOST to allocate on the default Host system of the current MIL application. Specify M_DEFAULT to have MIL select the most appropriate system on which to allocate the marker (it can be the default Host system or any already allocated system).
The MarkerType parameter specifies the type of marker to allocate. This parameter can be set to one of the following:
MarkerType | Description |
M_POINT | A single point. |
M_EDGE | An edge. |
M_STRIPE | A pair of edges. |
The ControlFlag parameter specifies the allocation control flag. This parameter must be set to M_DEFAULT.
The MarkerIdPtr parameter specifies the address of the variable in which the marker identifier is to be written. Since the MmeasAllocMarker function also returns the buffer identifier, you can set this parameter to M_NULL. If allocation fails, M_NULL is written as the identifier.
Marker parameters (characteristics) are set to the following default values upon allocation and can be changed at any time, using MmeasSetMarker. Note, a parameter with the value M_ANY will not be considered as a criteria for finding the marker in a target image.
Parameter description | Default value |
Marker orientation: | M_VERTICAL (vertical orientation) |
Marker polarity: | M_ANY for edge markers. M_ANY for the first (from top-left) edge of a stripe marker. M_OPPOSITE (opposite polarity from the first edge) for the second edge of a stripe marker. |
Marker contrast: | M_ANY |
Marker contrast variation: | M_ANY |
Marker width: | M_ANY |
Marker width variation: | M_ANY |
Marker position: | M_ANY |
Marker position variation | M_ANY |
Size of the marker’s box: | M_DEFAULT (image size) |
Origin of the marker’s box: | Top-left corner of the image x-coordinate = 0.0, y-coordinate = 0.0 |
Center of the marker’s box: | M_DEFAULT (image center) |
Angle of the marker’s box: | 0.0 |
Center of the left edge of the marker’s box: | M_DEFAULT (center of the left edge of the image) |
Center of the right edge of the marker’s box | M_DEFAULT (center of the right bordering edge of the image) |
Marker reference | M_DEFAULT (center of the marker) |
Edge strength | M_ANY |
Edge strength variation | M_ANY |
Edge threshold | 2.0 (2%) |
Stripe inside edges | M_ANY |
Stripe inside-edge variation | M_ANY |
Stripe inside position | M_ANY |
Box angle mode | M_DISABLE |
Box angle delta negative and Box angle delta positive |
M_DEFAULT (180° search for a symmetrical stripe marker; 360°, complete rotation, for non-symmetrical) |
Box angle tolerance | 5.0° |
Box angle accuracy | M_DISABLE |
Box angle interpolation | M_BILINEAR |
Box angle reference | M_BOX_CENTER |
Weight factors | Weight of 50% to the strength of an edge and the remaining 50% to any other parameters not set to M_ANY. |
Returned value
The returned value is the marker identifier. If allocation fails M_NULL is returned.
See also
《MmeasAllocMarker()函数》上有3条评论
评论已关闭。