ReadText, TrainFont and VerifyText Functions

Note: Cognex recommends that the OCRMax function be used instead of the ReadText, TrainFont and VerifyText functions, which are legacy functions. The OCRMax function has enhanced performance capabilities.

The ReadText, TrainFont and VerifyText functions divide the OCV/OCR functionality amongst the functions. The functions that should be used depend on whether the characters in the text string are known in advance (verification), or are unknown (recognition).

Both OCV and OCR require a font containing trained models of all possible characters that will be verified or recognized. The font is trained by dividing a text string into individual segments and then extracting a character example, called an instance, from each segment. Multiple instances of the same character can be extracted and merged into a single character model. The entire collection of character models defines the font database.

During OCV, the character at each position in the text string is compared to its corresponding character model in the user-trained font. To pass verification, the match score for each character compared to its model must (1) exceed the minimum accept threshold and (2) exceed the match scores of comparisons to all other character models in the font.

During OCR, each character in the text string is compared to all characters models in the user-trained font. Optionally, the number of character model comparisons may be limited to a smaller subset of characters, which can improve reading speed and accuracy. The character model with the highest match score determines each character's identity. To pass reading, the match score for every character in the text string must (1) exceed the minimum accept threshold and (2) exceed the match score of the next best character model by the specified difference accept threshold.

About Font Training

Font training defines character models (such as A, B, C, 5, or $) that are used to identify unknown text (OCR) and to verify the correctness of text (OCV). Multiple instances of a character model are often trained to help negate the effects of slight variances that may appear in a real-world vision application. Once you have established a model for each character that will be needed in your application, the In-Sight sensor can compare known or unknown characters against these models. The OCV/OCR Font Training dialog is used to define and maintain the character models of a font database.