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

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextAction context for working with Robin OCR 2.Robin.OCR2
Yes
File pathThe path to the file to extract the data from. Supported formats: jpg, jpeg.Robin.FilePath
Yes
Page numberThe 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 pathThe 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.FolderPathC:\doc\imgNo
File nameThe 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
OverwriteIf 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.BooleantrueNo
Results
TextThe text extracted from the source file.Robin.String

Image pathThe path to the image file with superimposed blocks.Robin.FilePath

Recognition confidenceImage 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:

Example of use

Task

Recognize license plate number from the image


Solution

Use actions "Create context with Robin OCR 2", "Extract text from file". 

Implementation

  1. Assemble a robot scheme consisting of actions:
  2. Set the parameters of the "Create context" action. 
  3. Set the parameters of the "Extract text from file" action. 
  4. Click on the "Start" button in the top panel. 

Result

The program robot completed successfully. 

The license plate number is recognized. The file with superimposed blocks is saved to the specified folder. 


  • Нет меток