Setting Up the Read Text (OCRMax) Identification Tool
The operation of the Read Text (OCRMax) Identification Tool involves two phases: train-time and run-time.
- Train-time involves loading multiple images of the characters that will be read, extracting them from the image, segmenting them and creating a trained font database of characters.
- Run-time involves placing the In-Sight vision system Online, acquiring images and extracting and classifying characters based on the trained font database.
- Load the first training image.
- Add the Read Text (OCRMax) Identification Tool to the job.
- Once the tool has been added, you will need to configure the region in the image. Position the tool’s region over the line of text to be read:
- The X-axis of the region should be parallel to the baseline of the text, and the Y-axis should be parallel to the vertical strokes of the characters; if there is no skew, the Y-axis is perpendicular to the X-axis.
- The positive direction of the X-axis corresponds to the reading direction.
- The region should only contain one line of text to be read, and some surrounding background. The background can be noisy and have significant background gradients/shading.
- In images with text that are clearly printed and have little noise, the region may be significantly larger than the line of text.
- For noisy images, the region should be relatively tight around the line of text.
As an approximate rule of thumb, the region should be larger than the line of text by at least half a character width on all sides, if possible (i.e. unless a border that large would cause other features to be enclosed within the region).
Note:
- The baseline of the text may have any angle (0-360) in the image, as long as the region is oriented at approximately the same angle.
- The region shouldn’t contain any other significant features in the image, other than the line of text. For example, the region shouldn’t partially enclose a different line of nearby text, or the edge of a label.
- If the region is curved, the tool will automatically unwrap the image into a straightened output region with a label "Curved Region Position," which may be re-positioned in the image, for display purposes.
-
The tool will automatically create character regions around the “text” that the tool determines to be characters, based on the default settings in the Segmentation tab.
- If the function has not correctly drawn the character regions around the text, there are two options:
- Use the Auto-Tune dialog and allow the Read Text (OCRMax) Identification Tool to automatically calculate the optimal segmentation settings. The Auto-Tune dialog combines the segmentation and training phases into one step. Follow the instructions in the Auto-Tune dialog topic to successfully segment and train a font database.
Go to the Segmentation tab and adjust the parameters until the text is correctly enclosed within individual character regions. Follow the Segmentation Process to successfully segment all of the characters in the image database prior to training.
Once the text has been segmented, the characters are ready to be trained and added to the font. First, select a font database by going to the Settings tab and selecting a font from the Font Library parameter.
-
If creating a new Custom font, go to the Training tab and enter the exact text string to be trained, and then press the Train All button. The characters will be added and stored in the selected Customfont.
To add additional characters to an existing Custom font, acquire or load another image containing the characters to be trained. If necessary, reconfigure the region and Segmentation parameters to ensure that the characters are properly segmented, and then press either the Train New or Train Selected buttons in the Training tab.
Note: A Custom font may be exported or imported as an OCRMax data file (*.ocm), from theTraining tab. - If using a pre-defined OCRA or OCRB font, simply position the tool’s region over the text to be read, and the tool will automatically segment the characters in the region, based on the defined Segmentation and Advanced parameter settings.
Once the tool has a trained font database, the tool is ready for run-time operation.
- Set the tool's run-time Inspection Mode, which determines if the tool will simply read text within its region, or if it will read and verify that the correct string was read.
- During run-time, the In-Sight vision system will be placed Online and acquire images as defined by the job. When an image is acquired, the text string in the image will be automatically segmented based on the Segmentation parameters, and the characters will be compared against the trained instances of the characters.