How to detect matched texts and get their color code in hexadecimal
Ensure that you have captured and saved one or more training images. These are
images that are similar in appearance to the images expected from the AUT during
automation. Note that it is less essential that the text strings be identical than that
such things as background, color, text size and font be similar to the expected test
Note: Note that the OCR Detector tool is not currently
supported on Linux and macOS.
You will train the system by establishing optimal settings for detecting text during
automation. To determine these settings, carry out the following steps:
With TestArchitect open, select .
In the OCR Detector Tool dialog box, click the button
next to the Select file to test field.
Note: Only .png images are supported.
In the Save dialog box, browse to the training image
containing the text you want to detect, then click
The selected training image is loaded into the OCR Detector
Tool dialog box.
For some images, it is easier to see the effect of the edge detection process
when the color information is removed from the image's display. To do this,
select the Gray Scale check box under the
Under the Settings tab, select the Pick
Color check box to enable color code selection and retrieval of
Tip: To zoom out or zoom in on the image, use Zoom Out
(-) or Zoom In (+) button,
The mouse cursor changes into a eyedropper pointer.
Position the eyedropper pointer over a portion of the text that needs
If the text varies in shading or color, you should choose a color that covers
most of the text or is most representative of all the text.
The color code at the selected text is displayed as three hexadecimal
numbers in RGB order, below the Pick Color check
Make note of these three hexadecimal
values for manual entry into the text color
whichever OCR-related built-in actions
use in your test.
Click the Scan Picture button to filter out colors which
do not match the color selected from the text.
The unmatched colors are filled with the inverse of the color selected
Click the Detect button to detect and highlight all
objects which match the color selected previously.
The detected objects are highlighted with bounding rectangles.
Click the Recognize button to scan and return texts
whose color matches the color selected previously.
A list of recognized text fragments is displayed. (Note that all text
fragments are presented in lowercase, and with spaces removed.)
Select the text you want to detect from the list of recognized texts.
The selected text is highlighted in the training image with its bounding
rectangle, with the (x,y) coordinates of the top-left corner of the bounding
If your text of interest is unrecognizable or improperly recognized, try using the