Extract text from file Version 2 (Рython)
Action group: Robin OCR
Description
The action allows you to extract text from an image. Recognition is performed using Robin OCR 2.
Action icon
Parameters and their settings
Property | Description | Type | Filling example | Mandatory field |
---|---|---|---|---|
Parameters | ||||
Context | Action context for working with Robin OCR 2. | Robin.OCR2 | Yes | |
File path | The path to the file to extract the data from. Supported formats: jpg, jpeg. | Robin.FilePath | Yes | |
Page number | The page number of the file to extract data from. Numbering starts from 1. If the field is not filled in, the data will be extracted from the first page. | Robin.Numeric | No | |
Folder path | The path to the folder where the recognized image with the superimposed blocks into which the action divided the data will be saved. To save the file, you also need to fill in the «File name» field. | Robin.FolderPath | C:\doc\img | No |
File name | The name of the image file with superimposed blocks (without extension). By default, a file with the extension *.png is created. To save the file, you also need to fill in the «Folder path» field. | Robin.String | No | |
Overwrite | If the value is «true» and an image file with the same name and extension exists in the specified folder, then the new file will overwrite it. If «false», the file will not be overwritten and the action will return an error. | Robin.Boolean | true | No |
Results | ||||
Text | The text extracted from the source file. | Robin.String | ||
Image path | The path to the image file with superimposed blocks. | Robin.FilePath | ||
Recognition confidence | Image recognition accuracy in the range from 0 to 1. | Robin.Numeric |
Special conditions of use
The robot will return an error if:
- an invalid format is supplied in the "File path" field
- there is already a file with the specified name on the specified path and the "overwrite" field = false
- incorrect page number (outside the range of the number of pages in the document)
The robot will NOT return an error, it will return an empty result if:
- no text is found in the image
the text is not recognized because it is not clearly written or the text language is not correct
Example of use
Text: y9060098
Recognition accuracy: 0,996
Image with blocks:
Recognize license plate number from the image
Use actions "Create context with Robin OCR 2", "Extract text from file".
Implementation
- Assemble a robot scheme consisting of actions:
- Set the parameters of the "Create context" action.
- Set the parameters of the "Extract text from file" action.
- Click on the "Start" button in the top panel.
The program robot completed successfully.
The license plate number is recognized. The file with superimposed blocks is saved to the specified folder.
Обзор
Инструменты контента