MIL_ID MarkerId, | //in |
MIL_INT64 Characteristic, | //in |
MIL_DOUBLE Min, | //in |
MIL_DOUBLE Low, | //in |
MIL_DOUBLE High, | //in |
MIL_DOUBLE Max, | //in |
MIL_DOUBLE ScoreOffset, | //in |
MIL_INT64 InputUnits, | //in |
MIL_INT64 ControlFlag | //in |
This function sets a score characteristic of a marker. MIL uses score characteristics to determine the best edge, stripe, or circle marker. This function only processes markers that have all the essential characteristics specified with MmeasSetMarker().
Unlike essential characteristics, which are either met or not, score characteristics can have a range of acceptable values; based on where the actual characteristic result falls within these specified limits, MIL calculates the characteristic's score. To calculate the final score of the marker itself (MmeasGetResult() with M_SCORE_TOTAL), MIL multiplies the score of all the marker's score characteristics. The marker with the highest final score is the one located by MmeasFindMarker().
To retrieve the characteristic's score, as well as other related information, such as the actual value of the characteristic (for example, the contrast of the marker in the image), you can use MmeasGetScore() with M_RESULT (after calling MmeasFindMarker()). To inquire the specified settings for a score characteristic, use MmeasGetScore() with M_MARKER.
To set the acceptable limits of a score characteristic, use the Min, Low, High, and Max parameters. The values for these parameters must adhere to the following conditions: Min <= Low <= High <= Max . If these conditions are not met, MIL generates an error. Characteristics that are greater than or equal to Low and less than or equal to High receive a score of 100%, while those that are greater than or equal to Min and less than Low, or greater than High and less than or equal to Max, receive a score above 0% and below 100%. Characteristics that are less than Min or greater than Max receive a score of 0% and are discarded.
You can set all limits except Min to M_MAX_POSSIBLE_VALUE, which represents a predetermined maximum established by MIL for that characteristic (the smallest possible value for any characteristic is always 0). Once a limit has been set to M_MAX_POSSIBLE_VALUE, all subsequent limits must also be set to M_MAX_POSSIBLE_VALUE. For example, if you are using M_EDGE_CONTRAST_SCORE, and set the Low parameter to M_MAX_POSSIBLE_VALUE, you must also set the High and Max parameters to M_MAX_POSSIBLE_VALUE.
By default, MIL only calculates the score of the marker's edge strength (M_STRENGTH_SCORE); therefore, the marker with the highest edgevalue (and all the essential characteristics) is found. When using another score characteristic to find the best marker, you might want to ignore the strength characteristic, to avoid its multiplicative influence. To do so, specify M_STRENGTH_SCORE and set Min and Low to 0, and set High and Max to M_MAX_POSSIBLE_VALUE.
You can reduce the influence of a characteristic on the total score by using a score offset. MIL calculates the lowest-possible nonzero score by subtracting the specified score-offset from 100% (100% - ScoreOffset = LowestPossibleScore). Since characteristics can, by default, score above 0%, the default score-offset is equivalent to 100% (calculated as, 100% - 100% = 0%). Unless you are developing an advanced application, the default is typically appropriate. Values below Min and above Max are set to 0, whereas values between Min and Low are mapped to scores between this LowestPossibleScore and 100%, and values between High and Max are mapped to scores between 100% and this LowestPossibleScore.
Specifies the identifier of the measurement marker for which to set the score characteristic.
Specifies the score characteristic to set.
The values in the table below are for specifying a score characteristic for an edge, stripe, or circle marker.
For specifying a score characteristic for
an edge, stripe, or circle marker
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_EDGE_CONTRAST_SCORE |
Specifies that MIL must calculate a score, as a percentage, based on the grayscale difference between the start and end of the intensity transition from which the marker's edge is established. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_EDGEVALUE_PEAK_CONTRAST_SCORE |
Specifies that MIL must calculate a score, as a percentage, based on the grayscale difference of the intensity transition between the first zero edgevalues on both sides of the established edge peak. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_STRENGTH_SCORE |
Specifies that MIL must calculate a score, as a percentage, based on the mean edgevalue (strength) of the marker. (more details...) |
The values in the table below are for specifying a score characteristic for an edge or stripe marker.
For specifying a score characteristic for
an edge or stripe marker
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DISTANCE_FROM_BOX_ORIGIN_SCORE |
Specifies that MIL must calculate a score, as a percentage, based on the distance between the position of the box search region's origin and the position of the marker. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SPACING_SCORE |
Specifies that MIL must calculate a score, as a percentage, based on the typical distance (spacing) between consecutive edge or stripe occurrences of a multiple marker. (more details...) |
The values in the table below are for specifying a score characteristic for a stripe marker.
For specifying a score characteristic for
a stripe marker
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_EDGE_INSIDE_SCORE |
Specifies that MIL must calculate a score, as a percentage, based on the number of edges inside a stripe marker. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_STRIPE_WIDTH_SCORE |
Specifies that MIL must calculate a score, as a percentage, based on the distance (width) between the stripe's two outermost edges. (more details...) |
The values in the table below are for specifying a score characteristic for a circle marker.
For specifying a score characteristic for
a circle marker
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_RADIUS_SCORE |
Specifies that MIL must calculate a score, as a percentage, based on the linear distance between the circle's center and its circumference (radius). (more details...) |
Specifies the minimum limit, which MIL uses to calculate the characteristic's score. Any value less than the minimum limit receives a score of 0%.
For M_STRENGTH_SCORE, this value is set to 0 by default.
For specifying the minimum acceptable
limit
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
0 <= Value < Low |
Specifies the minimum acceptable limit. (more details...) |
Specifies the low limit, which MIL uses to calculate the characteristic's score. Any value less than the lowest limit and greater than or equal to the minimum limit receives a score above 0% and below 100%, while any value greater than or equal to the lowest limit and less than or equal to the highest limit receives a score of 100%.
For M_STRENGTH_SCORE, this value is set to M_MAX_POSSIBLE_VALUE by default.
For specifying the low acceptable
limit
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_MAX_POSSIBLE_VALUE |
Specifies that the low acceptable limit is equivalent to the greatest possible value. |
||||||||||||||||||||||||||||||||||||||
Min <= Value <= High |
Specifies the low acceptable limit. (more details...) |
Specifies the high limit, which MIL uses to calculate the characteristic's score. Any value greater than the highest limit and less than or equal to the maximum limit receives a score above 0% and below 100%.
For M_STRENGTH_SCORE, this value is set to M_MAX_POSSIBLE_VALUE by default.
For specifying the high acceptable
limit
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_MAX_POSSIBLE_VALUE |
Specifies that the high acceptable limit is equivalent to the greatest possible value. (more details...) |
||||||||||||||||||||||||||||||||||||||
Low <= Value <= Max |
Specifies the high acceptable limit. |
Specifies the maximum limit, which MIL uses to calculate the characteristic's score. Any value greater than the maximum limit receives a score of 0%.
For M_STRENGTH_SCORE, this value is set to M_MAX_POSSIBLE_VALUE by default.
For specifying the maximum acceptable
limit
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_MAX_POSSIBLE_VALUE |
Specifies that the maximum acceptable limit is equivalent to the greatest possible value. (more details...) |
||||||||||||||||||||||||||||||||||||||
High <= Value <= M_MAX_POSSIBLE_VALUE |
Specifies the maximum acceptable limit. |
Specifies the characteristic's score-offset. This allows you to indirectly specify the lowest non-zero score that a characteristic can receive. The measurement module subtracts the score-offset from 100% to establish the lowest possible score assigned to values between Min and above Max and values between Min and Low.
For specifying the
score-offset
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default value; the default value is 100.0%. (more details...) |
||||||||||||||||||||||||||||||||||||||
0.0 <= Value <= 100.0 |
Specifies the score-offset, as a percentage. |
Specifies the units with which to interpret the Min, Low, High, and Max parameter values, when applicable. This essentially sets the input coordinate system to use.
You must set this parameter to M_DEFAULT for the following score characteristics: M_EDGE_CONTRAST_SCORE, M_EDGEVALUE_PEAK_CONTRAST_SCORE, M_EDGE_INSIDE_SCORE, and M_STRENGTH_SCORE. In these cases, M_DEFAULT indicates that the input unit information is not required.
For specifying the input
units
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_PIXEL, if the score characteristic's settings are affected by input units. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_PIXEL |
Specifies that the values will be interpreted in pixel units, with respect to the pixel coordinate system. |
||||||||||||||||||||||||||||||||||||||
M_WORLD |
Specifies that the values will be interpreted in world units, with respect to the relative coordinate system. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milmeas.lib. |
DLL | Requires mil.dll; milmeas.dll. |