OCR Support

This section describes the APIs that JIA developers can use to get the text of an object using Optical Character Recognition (OCR). JIA supports the retrieval of both English and non-English text.

When working with languages other than English, a language file of the relevant language needs to be provided as a parameter of the GetText () API. The language code used in the API is based on the well known ISO 639-3 standard.

A wide selection of pre-prepared language files can be viewed and downloaded from: https://code.google.com/p/tesseract-ocr/downloads/list.
The downloaded files should be extracted to <installation>\ ScreenControls\libs\tessdata.

IMPORTANT: Due to limitations of the OCR libraries, retrieving text using OCR is not reliable and should be used with caution. For accurate results, it is recommended to use the CopyTextUsingClipboard() API whenever possible.

The following API operations support OCR:

JIA Screen Control API

Description

Parameters

Text

Gets/Sets the text of an object (English language), using the default settings of the text property.

 

GetText()

Gets the text of an object (non-English language).

language: A string parameter that provides the language file to be used.

useGrayScale = True/False
Indicates whether the image is converted to a gray scale image. Default is true.

scaleRatio: Specifies how much the image should be shrunk or enlarged. The default value is 2.

When working with these APIs, it is recommended to experiment with different parameter values until you achieve the best possible results.