# Scoring Functions

For each scoring method, the selected scoring method type produces a raw score. You control the effect that this raw score has on the overall score for an edge pattern candidate by defining a scoring function. A scoring function maps a raw score to a mapped score. The mapped scores for each scoring method for an edge pattern candidate are combined to form the overall score for that edge pattern candidate.

You define a scoring function by specifying low and high input and output values. The following figure shows a scoring function.

You define the scoring function by defining values for xc, x1, x0, y1, and y0. The Caliper tool uses the scoring function you define to map raw scores to mapped scores as follows. Raw scores above x0 are mapped to a score of y0. Raw scores below xc are mapped to a score of 0. Raw scores between xc and x1 are mapped to a score of y1. Raw scores between x1 and x0 are mapped linearly to the range of scores between y1 and y0.

The values you define for y0 and y1 must be between 0.0 and 1.0. You can specify any values for xc, x1, and x0, including negative values. You would specify negative values for one or more of the xc, x1, and x0 points if you expected raw scores less than zero.

The scoring function illustrated in the previous figure would be appropriate for a case where higher raw scores should produce higher mapped scores, such as a contrast scoring method where greater the edge contrast should produce a higher score.

In other cases, such as a positional scoring method where the edge pattern candidate is expected to be at or near the center of the projection region, a higher raw score should result in a lower mapped score. In a case such as this, you specify a value for x1 that is greater than x0, and a value for xc that is greater than x0. The following figure shows a scoring function that is appropriate for a case where higher raw scores should result in lower mapped scores.

You must specify one and only one scoring function per scoring method, although you can specify any number of geometric scoring methods per Caliper tool.