When the StringReader step performs a read operation, it assigns a score between 0 and 100 to every character candidate as well as the string candidate to which it belongs. The higher the score, the better the candidate.
A string has an Acceptance and Target Acceptance score as well as a Certainty and Target Certainty score. A character has an Acceptance, Homogenity, and Similarity score.
A character's score is calculated as the average value of the character's similarity and homogeneity score. If the character's score is higher or equal to the user-specified character acceptance score, then the character is considered part of the string.
The character's similarity score quantifies how closely the character in the target image resembles the character in the font. This resemblance is based solely on how the character "looks", disregarding variations in contrast, size, aspect ratio, scale, and baseline. For example, an 'A' is still an 'A', even if the 'A' in the target image is twice as big as the 'A' in the font.
The character's homogeneity score quantifies the similarity between the character in the target image and the other characters of the string in the target image. To calculate the character's homogeneity score, many character traits are taken into account, such as variations in contrast, size, aspect ratio, scale, and baseline. If each of these characteristics (and others not mentioned) is the same between the character and all other characters of the string in the target image, the resulting homogeneity score for that character would be 100. Note, however, that this is seldom the case.
A string's score is calculated as the average score of all the characters in the string. To be accepted as a string result, both the string's score and the string's target score must be greater than or equal to the string acceptance score.
However, if a candidate string's score and target score are calculated and found to be higher or equal to the certainty score, then the candidate is immediately considered a string result, without reading the rest of the target image for a string with higher scores (provided the specified number of strings to read has been read).
The string target score is computed from the unread characters that are in the region of the string in the target image. These otherwise readable characters remain unread due to user-specified constraints, such as scale and grammar restrictions. The more unread characters there are, the lower the target score will be.
If both the string score and the string target score of a string candidate are above their respective certainty levels, the candidate is immediately considered a string result, without reading the rest of the target image for a string with higher scores (provided the specified number of strings to read has been read).
The scale of the string is the median scale, in the X-direction, of each individual character in that string. By default, strings are located in the target image at a nominal scale of 1.0, with a maximum permitted scale of 2.0 and a minimum permitted scale of 0.5. This means that strings in the target image that have a scale between 0.5 and 2.0 can be returned as results.
For example, you want to write an application that reads the string 'ABCD' within a scale range of 0.5 to 2.0. However, you want to ensure that the scale of each individual character in the string only ranges between 0.9 and 1.1. To do so, go to the String section of the MIL String Reader Interactive Utility and set Scale Reference to 1.0, Scale Max Factor and Scale Min Factor to 2.0 and 0.5. From the characters section, set Char. Scale Max Factor and Char. Scale Min Factor to 1.1 and 0.9.
The aspect ratio of a string is the median aspect ratio of each individual character in that string. The aspect ratio of a character is the ratio of its scale in the X-direction by its scale in the Y-direction. By default, strings are located in the target image at a nominal aspect ratio of 1.0, with a maximum permitted aspect ratio of 1.25 and a minimum permitted aspect ratio of 0.8. This means that strings in the target image that have an aspect ratio between 1.25 and 0.8 can be returned as results.
For example, you want to write an application that reads the string 'ABCD' within an aspect ratio range of 0.5 to 2.0. However, you want to ensure that the aspect ratio of each individual character in the string only ranges between 0.9 and 1.1. To do so, go to the String section of the MIL String Reader Interactive Utility and set Asp. Ratio Reference to 1.0, Asp. Ratio Max Factor and Asp. Ratio Min Factor to 2.0 and 0.5. From the characters section, set Char. Aspect Ratio Max Factor and Char. Aspect Ratio Min Factor to 1.1 and 0.9.