Page tree
Skip to end of metadata
Go to start of metadata

Last updated: May 26, 2020 09:06

The different Visual Analysis functions support the following set of parameters that define the parameters of the screen area to compare the input "needle" to for visual recognition.

NameTypePossible ValuesDescription
threshold Integer20-100The acceptable match level percentage, between 20 and 100.
Too low values can lead to a false positive result, while too high values can lead to a false negative result.
scrollingStringscroll | noscrollScroll until the label is found.
noscroll (default) - do not scroll
scroll - scroll
Scroll cannot be used together with a positive Timeout, because they dictate a different behaviour when the needle is not found. When scrolling is enabled, the timeout must be zero.
Scroll results in a longer execution time.
maxscroll Integer0 - 100The maximum number of scroll actions to perform before returning.
Finding the label will stop the scrolling.
Effective values are in the range of 0-100. <default: 5>
label.directionString

Inside | Above | Below | Left | Right | Leftmost | Rightmost

The label position relative to the button.
Used alongside the offset parameter.
Rightmost and Leftmost Label position values represent distance from screen edge.
Inside - The label is part of the button
Above - The label is above the button
Below - The label is below the button
Left - The label is to the left of the button
Right - The label is to the right of the button
Leftmost - The Button is aligned to the right, and its label is to the left
Rightmost - The Button is aligned to the left, and its label is to the right
label.offset String X and Y values separated by commaValue can be in pixels or in percentage of screen height (0-100).
For percentage use the % sign. Example - 20%
Used alongside the Label position parameter. If label position is "none", then label offset is "0". Otherwise, label offset default is 10%.
screen.top String
The top value of the screen area where to search for the label.
Value can be in pixels or in percentage of screen height (0-100). For percentage use the % sign. Example - 20%
Default is to search the entire screen.
It is recommended to use the percentage value as it does not rely on the screen resolution.
screen.height String
The height value of the screen area where to search for the label.
Values can be in pixels or in percentage of screen height (0-100). For percentage use the % sign. Example - 20%
Default is to search the entire screen.
It is recommended to use the percentage value as it does not rely on the screen resolution.
screen.leftString 
The left value of the screen area where to search for the label.
Values can be in pixels or in percentage of screen width (0-100). For percentage use the % sign. Example - 20%
Default is to search the entire screen.
It is recommended to use the percentage value as it does not rely on the screen resolution.
screen.width String
The width value of the screen area where to search for the label.
Values can be in pixels or in percentage of screen width (0-100). For percentage use the % sign. Example - 20%
Default is to search the entire screen.
It is recommended to use the percentage value as it does not rely on the screen resolution.
matchString

Same size | Any size | Bounded size

The needle comparison method.
Same Size - needle and haystack are from the same origin (device screen) and size, matching is faster and simpler
Any Size - needle and haystack are either not from the same origin (needle is from another device or other source) or not in the same size (different ratio or size), matching is slower and more complex
Selecting Any Size increases the analysis time. The timeout values should respectively be increased.
Bounded Size - same as Any Size with restrictions on possible needle sizes.
This mode allows decrease the any size analysis time by using apriori knowledge on needle sizes or by decreasing the size of a haystack.
operationString

Single tap | Double tap | Long tap | Trackball roll | No touch

 
The touch operation to perform on the found label location.
Single tap
Double tap
Long tap
Trackball roll
No touch
repeat Integer
The number of times to repeat the operation. Relevant for tap and double tap actions only. <default: 1>
relation.directionString

Left | Right | Above | Below | Left-Above | Left-Below | Right-Above | Right-Below | Inside

The direction of the related region, stored in memory from the last found needle, in relation to the searched needle.
For more information see the Visual Relations series.
Left - The related region is to the left of the searched needle
Right - The related region is to the right of the searched needle
Above - The related region is above the searched needle
Below - The related region is below the searched needle
Left-Above - The related region is to the left and above the searched needle
Left-Below - The related region is to the left and below the searched needle
Right-Above - The related region is to the right and above the searched needle
Right-Below - The related region is to the right and below to the searched needle
Inside - The searched needle is inside the related region boundaries of the related region
relation.inlineString

Horizontal | Vertical

 
The search area is in-line with the related region, stored in memory from the last found needle.
For more information see the Visual Relations series.
Horizontal - The needle is within the height (top to button) boundaries of the related region
Vertical - The needle is within the width (left to right) boundaries of the related region
sourceString

Primary | Camera

The source for retrieving the screen content.
Primary - Digital screen image
Camera - Analog screen image
intervalInteger0The minimum time interval, in seconds, for a single analysis.
If the analysis operation takes less than the interval, wait the remaining time before the next analysis operation.
backlightString
The key sequence to perform the backlight operation.
Example -
VOL_UP
For best practice, use a key that will not change the screen.
nextString

SWIPE_UP | SWIPE_DOWN | SWIPE_RIGHT | SWIPE_LEFT | UP | DOWN | RIGHT | LEFT

The key sequence to perform the scroll operation.
For more information see the Create custom swipe gestures post.
reportStringScreenshot | Screenshot on error | NoneThe value to display in the report.
Screenshot (default) - display screenshot
Screenshot on error - display screenshots only for actions in error
None - display nothing
It is recommended to reduce the report image resolution in very long scripts that result in large report files.
report.resolutionStringHigh | Medium | LowThe image resolution.
High (default)
Medium
Low
It is recommended to reduce the resolution in very long scripts that result in large report files.
grid String
The column name to be used for grid view in the report.
Selecting this parameter creates the grid report.

Image common parameters

The following parameters are supported by Visual Analysis functions for image identification.

NameTypePossible ValuesDescription
image.top String
The top value of the image area defining the label.
Value is in pixels. Default is the entire image.
image.height String
The height value of the image area defining the label.
Value is in pixels. Default is the entire image.
image.left String
The left value of the image area defining the label.
Value is in pixels. Default is the entire image.
image.width String
The width value of the image area defining the label.
Value is in pixels. Default is the entire image.
matchGeneric StringTM_SQDIFF_NORMED | TM_CCORR_NORMEDA generic image compare parameter.
Use this to provide additional image compare specifications that are not exposed as function parameters.

Text common parameters

The following parameters are supported by Visual Analysis functions for text (OCR) identification.

NameTypePossible ValuesDescription
sourceStringprimary, native, camera, autoThe source for retrieving the screen content.
Primary - Screenshot taken from the device (higher resolution but slower)
Native - Native device controls
Camera - Screenshot taken from the video stream (lower resolution but faster)
Auto  (default) - Native device controls, if available.
       Else, digital screen image, if available.
       Else, analog screen image
indexInteger
In case the needle has multiple occurrences on the screen, enter the index of the required occurrence.
profileStringdefault |
DocumentConversion_Accuracy |
DocumentConversion_Speed |
DocumentArchiving_Accuracy |
DocumentArchiving_Speed |
BookArchiving_Accuracy |
BookArchiving_Speed |
TextExtraction_Accuracy |
TextExtraction_Speed |
FieldLevelRecognition |
BarcodeRecognition
Use when text cannot be found on the device screen.
Try all the profiles with the word accuracy. Per profile, try changing the DPI (96 or 300 or 120).
ocrProperty
A generic OCR parameter.
Use this to provide additional OCR specifications that are not exposed as function parameters.
Example - "isolate=true" It is possible to provide multiple specifications.

*This parameter is irrelevant when using native screen source.
analysisStringfull | automatic | manualThe image analysis mode.
The device screen may contain text and images.
Automatic - OCR distinguishes between text and images, filtering out images.
Manual - OCR assumes text only. Use alongside the Inverted text parameter. 
Full - OCR tries both automatic and manual.

*This parameter is irrelevant when using native screen source.
inverseStringany | yes | noThe text is likely to appear in inverted colors (dark text on light background). Use only if 'analysis' is set to 'manual'.
Yes - Text is inverted
No - Text is normal, not inverted
Any - Text might be inverted or not, checked automatically by the system

*This parameter is irrelevant when using native screen source.
languageStringEnglish | Dutch | French | German | Italian | Spanish | PortugeseStandard | Russian | HebrewThe OCR language to use.It is possible to select multiple languages.
For languages that do not appear in the drop down menu, please contact Perfecto Mobile Support to enable.

*This parameter is irrelevant when using native screen source.
policyStringauto | accuracy | performance

The text recognition accuracy policy.
Selecting the Accuracy value will increase the operation time.
Auto (default) - shifted toward recognition accuracy with a moderate impact on the recognition speed.
Accuracy - shifted toward maximum recognition accuracy. 
Performance - shifted toward recognition speed.

*This parameter is irrelevant when using native screen source.

wordsStringsubstring | wordsThe search option to match only whole words in the haystack, or also part of other words
Example - 
Define whether 'person' in 'personal' is a good match or not. 
words - match whole needle words in the haystack
substring - match whole or sub-string words in the haystack
ignorecaseStringcase | nocaseThe search pattern case sensitivity.
nocase- insensitive
case- sensitive
ignorespaceStringspace | nospaceThe option to ignore spaces within search pattern words.
nospace- ignore
space- do not ignore
ignorepunctStringpunct | nopunctThe option to ignore punctuation characters when matching text.
nopunct- ignore
punct - do not ignore
exactStringtrue | falseThe option to find the exact needle phrase with no errors.

*This parameter is irrelevant when using native screen source.

What are OCR Profiles?

Each OCR profile sets optimal values for a large number of OCR parameters to match a particular scenario.

Due to profile complexity and the large number of parameters involved, it is highly recommended to use one of the predefined set of profiles. This also provides backward compatibility, since most OCR versions modify/remove some parameters from the profile definition, yet the profile name is preserved and achieves similar/better results.

The default OCR profile is TextExtraction_Accuracy; use other values only in rare cases, such as when speed is of importance.

Below is a table listing the various predefined OCR profiles and their purported usage and links for further information.

Profile nameUsage
DocumentConversion_AccuracyText recognition, accuracy mode.
DocumentConversion_SpeedText recognition, speed mode.
DocumentArchiving_AccuracyArchived text recognition, accuracy mode.
DocumentArchiving_SpeedArchived text recognition, speed mode.
BookArchiving_AccuracyBook-formatted text recognition, accuracy mode.
BookArchiving_SpeedBook-formatted text recognition, speed mode.
TextExtraction_AccuracyText image recognition (such as pdf or scan), accuracy mode.
TextExtraction_SpeedText image recognition (e.g. pdf or scan), speed mode.
FieldLevelRecognitionField text recognition (e.g. bank account balance).
BarcodeRecognitionBarcode recognition.

For more information on other aspects of the OCR analysis, see the following information: