Description
Recognizes an image text using Google OCR technology.
Note. We do not store processed images on our servers.
Prerequisite
To use this activity, the Bot Runner should be connected to the Orchestrator SaaS via a valid access token. For more information about this token connection, read this article.
Google Cloud Platform credentials
To use Google Cloud services, you need to log in to the portal and create a project. After that, you need to activate the service "Cloud Vision API". Then navigate to the menu "APIs & Services" → "Credentials". On this page, you will find the "API Key". That is what you need to use as a password when creating an account. We will describe it in more detail in the next section of this article.
Parameters
API Key
You can connect your Google Cloud OCR service account to Studio Pro to work with this activity. Click on the "ADD NEW ACCOUNT" button to add your account.
In the appeared window you will see a form for creating an account:
- Service — this field can be filled in any way, it will not affect the operation of this action.
- Login — this field can be filled in any way, it will not affect the operation of this action.
- Password — here you need to specify the
API Key
.
For testing and development purposes in Studio Pro, you can use the complimentary OCR plan provided by ElectroNeek according to your pricing plan. To use the complimentary plan, select the "Not set" option in the activity parameters.
Please note that since the Bot Runner product is free, no complimentary plan will be used when exporting the bot to .neex format. Thus, to build an attended-automation system you need to specify your account in the OCR service when working with the .neek file, and then export the bot to .neex.
Path
-
Set a value: enables you to directly write the desired path. Clicking the 'Pick' button allows you to manually choose the path.
-
Save the previous step result: chooses the previous activity result as a path.
-
Calculate a value: enables you to use available properties and methods to form a path.
Supported formats
-
jpeg
-
png
-
bmp
-
gif
-
svg
Maximum file size: 20 MB
Maximum image size: 75 megapixels (length × width)
If the "Recognition area" option is selected the robot will recognize the text inside the specified rectangular area. To set the area, the coordinates of the top left corner must be set as well as the rectangle width and height.
-
Set a value: allows you to specify the horizontal axis coordinate of the top left corner.
-
Calculate a value: allows you to use available variables, properties, and methods to specify the horizontal axis coordinate of the top left corner.
-
Set a value: allows you to specify the vertical axis coordinate of the top left corner.
-
Calculate a value: allows you to use available variables, properties, and methods to specify the vertical axis coordinate of the top left corner.
-
Set a value: allows you to specify the rectangle width.
-
Calculate a value: allows you to use available variables, properties, and methods to specify the rectangle width.
Height
-
Set a value: allows you to specify the rectangle height.
-
Calculate a value: allows you to use available variables, properties, and methods to specify the rectangle height.
Comment
Contains an annotation of the activity. The input text will be displayed above the activity name.
Result
Along with the "Recognize text" activity block, the "Save value to google_ocr_content variable" block also appears on the canvas. This is the variable where the text recognized from the image will be saved.
The result is an array of 'key-value' objects. This object contains the following keys and values:
{
"text": "recognized word",
"location": {
"y": "y coordinate of the top left corner of the rectangle with the word",
"x": "x coordinate of the top left corner of the rectangle with the word",
"width": "width of the rectangle with the recognized word",
"height": "height of the rectangle with the recognized word"
},
"language": "language of the recognized word"
}
Usage recommendations
In addition to the obvious reason for using this activity (recognizing text from an image), note that the coordinates of the words in the object array are also returned. This information may be useful in some RPA processes.