Using the OCR Tuner
The OCR Tuner lets you adjust these OCR properties while viewing the results in the Capture Area and Text Read area in the UI to improve your OCR searches. After you make adjustments to these OCR properties, you can save them as a template style and use this and other template styles as explained in Text Preferences.
DPI: By default, OCR uses 72 DPI screen resolution for searches. If the resolution on your SUT is significantly different, you might need to adjust the DPI for the search.
Valid Words: This parameter limits the words that the OCR engine recognizes. By default, the engine uses the entire set of words for the language (or languages) in the current text platform. You can use the asterisk as a wildcard so that the OCR engine looks only for the words in your original text string.
Valid Characters: This parameter limits the characters that the OCR engine recognizes. By default, the engine uses the entire set of characters available for the language (or languages) in the current text platform. You can use the asterisk as a wildcard so that the OCR engine looks only for the characters in your original text string.
Valid Pattern: This property is a string that takes a regular expression value and returns only characters or words that match the specified pattern.
Contrast: Select this checkbox if you want OCR to treat the ReadText() rectangle as a flat, two-color image. This option can be useful when working with anti-aliased text. It filters the screen of the SUT so that it appears two-toned to the OCR engine. Contrast relies on the following settings:
- Contrast Tolerance: A measure of how much a pixel can differ from the RGB value of the selected color and still be considered the primary color.
- Color: Click the color well and select a new color using the Colors panel. OCR treats this color as the primary color of the ReadText() rectangle. It is generally advised to select the background color for this selection.Tip: Use the color picker in the Colors panel to copy a color from any place in your display, including the Viewer window. Click the magnifying glass in the Colors panel, then click again wherever you see the color you would like to copy.
Enhance Local Contrast: Select this checkbox if you want OCR to automatically increase the local contrast of the image.
Enable Aggressive Text Extraction: Select this checkbox if you want OCR to extract as much text from the image as possible.
Case Sensitive: Select this checkbox to enable case-sensitive searching.
Ignore Spaces: Select this checkbox to have OCR searches ignore spaces between characters during a search.
Ignore Lines: Select this checkbox to have OCR searches ignore new lines during a search.
Language: Use this drop-down menu to add or remove OCR recognition languages. You can select multiple languages for use in OCR searches. To enable additional languages, navigate to Eggplant > Preferences, then click Text and scroll to Enabled Languages.
You can adjust your OCR properties from several UI locations:
Use the following steps as a guideline when using the OCR Tuner:
- Use the Capture Area as explained in the Capture Area topic.
- As you make changes in the Capture Area, view the text that OCR is reading in the Text Read area of the UI and search for the text being read in the top of the OCR Tuner.
- Make changes to the properties in the OCR Settings area of the UI that might improve your OCR search.
- Click Apply to commit any changes, then view the result in the Text Read area of the UI to see the improvement.
Click Copy to save the settings into the clipboard area for later use. Also, if you think you might reuse these settings in other searches, enter a style name next to the Save Style button, then click Save Style.
The OCR Update Panel lets you adjust the OCR properties discussed earlier to improve your OCR searches. For detailed information about this approach, see the Tuner Tab.
The Text Preferences UI area lets you adjust the OCR properties discussed earlier to improve your OCR searches. For detailed information about this approach, see Text Preferences.