Read Words Activity
Overview
The Read Words activity extracts text content from a specified image using Optical Character Recognition (OCR). It transfers the recognized text, line by line, into a designated variable in JSON format. Optionally, you can define a specific region within the image for text extraction.
Parameter Table
| Field | Description | Requirement |
|---|---|---|
| File Name | The full path and name of the image file (e.g., .png, .jpg) to be processed. | Required |
| X-coordinate | The X-coordinate (horizontal position) of the top-left corner of the region to read within the image. Must be used in conjunction with Y-coordinate, Width, and Height. | Optional |
| Y-coordinate | The Y-coordinate (vertical position) of the top-left corner of the region to read within the image. Must be used in conjunction with X-coordinate, Width, and Height. | Optional |
| Width | The width of the region to read within the image. Must be used in conjunction with X-coordinate, Y-coordinate, and Height. Value must be an integer. | Optional |
| Height | The height of the region to read within the image. Must be used in conjunction with X-coordinate, Y-coordinate, and Width. Value must be an integer. | Optional |
| Language | The language library to use for Optical Character Recognition (OCR). Supported options include TUR, ENG, RUS, OCR-B and NLD. | Required |
| Result Text Name | The name of the variable where the OCR result, in JSON format, will be stored. | Required |
Action Types & Examples
OCR Result JSON
- Format:
string(JSON) - Example Result:
{"result":[{"lineNumber":1, "words":[{"text":"Hello","x":10,"y":10,"width":200,"height":20}, {"text":"World","x":220,"y":10,"width":205,"height":20}]}]}
OCR Result JSON with Confidence Score
- Format:
string(JSON) - Example Result:
{"result":[{"words":[{"confidence":81,"x":2,"width":53,"y":4,"text":"Success","height":17}, {"confidence":78,"x":59,"width":97,"y":4,"text":"Ratio","height":17}],"lineNumber":1}]}
Implementation Examples
Field Setup
File Name:C:\Robusta\document.pngLanguage:ENGResult Text Name:ocrOutput
Execution Parameters
File Name:C:\Robusta\invoice.pngX-coordinate:50Y-coordinate:100Width:300Height:50Language:TURResult Text Name:invoiceHeader
Technical Notes
When defining a specific region for text extraction, all four coordinate parameters (
X-coordinate,Y-coordinate,Width,Height) must be provided. If any of these are left blank, all four must be blank, in which case the entire image will be processed. TheWidthandHeightvalues must be integers. The OCR result, including text and optional confidence scores, is transferred to the specified variable in JSON format.