set ocr setting

Set various thresholds to optimize the detection of bitmapped text in an image under test.
NameDescriptionTypeModifier
fill color

(Optional) One or more sets of (x, y) coordinate pairs representing points to be filled with an inverse of the color selected from the desired text, with each set accompanied by a color range.
The format is as follows: x1, y1|inverse color range; x2, y2|inverse color range 2; ... ; x(i), y(i)|inverse color range(i);

  • x: Horizontal coordinate of point in which the inverse color is to be filled. Position is relative to the left edge of the active area (Units: pixels ).
    Default value: 0
  • y: Vertical coordinate of point in which the inverse color is to be filled. Position is relative to the top of the active area (Units: pixels ).
    Default value: 0
  • inverse color range: Threshold for inverting the image pixel's color. Only pixels with color in the range of the threshold are inverted; otherwise they remain intact (valid range: 0 to 255).
    Default value: 128

StringNone
min edge length

(Optional) Minimum length, in pixels , for an edge to be ignored as possible text (Or, if you prefer, the maximum length, plus 1, for an edge to be considered as possible text). During the line-removal phase, any edge (horizontal or vertical only) whose length is greater than the specified value is eliminated for consideration as text (Units: pixels).

Default Value: 50
Value Set50
linking distance

(Optional) Maximum horizontal distance between adjacent characters for those characters to be treated as members of a single . The linking distance is given as a percentage of the average height (not width) of the detected font sizes of the text on either side of the gap. Adjacent characters are grouped together as a fragment when the distance between each is less than the specified threshold value. If the horizontal spacing between two characters exceeds this threshold, they are treated as members of separate bitmap text fragments (Valid range is 1 to 500).

Default Value: 50
Value Set50
None
This action may be used within the following project items: test modules and user-defined actions.
        
        	fill color	min edge length	linking distance			
set ocr setting	296,129|128;271,566|128;0,0|128;	50	50			
&nbsp						
	window	control	rect	text	index	text color
check text exists	home			Churchy Joes		FEFEFE
&nbsp						
clear ocr setting						
        
    

1 In the case of iOS device testing, screen units are points (See ).

  • The bitmap text fragment is an OCR-recognized string of text within a bitmap image.

  • Built-in UI actions applied to iOS devices specify screen coordinates in points rather than pixels (For further details, refer to the built-in action get screen resolution).
  • In most cases of text detection, the default OCR detection thresholds are acceptable. Use this action in difficult cases, such as images with noisy backgrounds, or ones whose text color is very similar to the background.
  • For ease of use, values of the arguments to this action can be derived with the OCR Detector Tool, which allows you to establish the optimum settings for the detection of text under difficult circumstances. Values may be copied from the tool and pasted into the test editor.
  • If no set ocr setting action(s) are declared in action lines, default values of its arguments values are used.
  • It is recommended that whenever you no longer need the current advanced OCR settings values, clear them by using the built-in action clear ocr setting.
  • This action supports the <ignore> modifier. If the string <ignore> is present as the value of any of the arguments, or any argument contains an expression that evaluates to <ignore>, the action is skipped during execution.

Copyright © 2023 LogiGear Corporation. All rights reserved. LogiGear is a registered trademark, and Action Based Testing and TestArchitect are trademarks of LogiGear Corporation. All other trademarks contained herein are the property of their respective owners.

LogiGear Corporation

1730 S. Amphlett Blvd. Suite 200, San Mateo, CA 94402

Tel: +1(800) 322-0333