Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

...

Extract text from file Version 2 (Рython)

Группа действийAction group: Robin OCR 

Описание

Действие позволяет извлечь текст из изображения. Распознавание происходит при помощи Robin OCR 2.

Image Removed

Настройки

...

Description

The action allows you to extract text from an image. Recognition is performed using Robin OCR 2

Action icon

Image Added

Parameters and their settings

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextAction context for working with

Свойство

Описание

Тип

Пример заполнения

Обязательность заполнения поля

Параметры

Контекст

Контекст действия для работы с
Robin OCR 2.
Экземпляр Paddle OCR
Robin.OCR2

Да

Путь к файлуПуть к файлу изображения, из которого нужно извлечь данные. Поддерживаемые форматы: jpg, jpeg, bmp, dib, rle, jpe, jfif, gif, tif, tiff, png. 

Yes
File pathThe path to the file to extract the data from. Supported formats: jpg, jpeg.Robin.FilePath
Да

Yes
Номер страницыНомер страницы файла, с которой нужно извлечь данные. Нумерация начинается с 1. Если поле не заполнено, данные будут извлечены с первой страницы
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.FolderPath
НетИмя файлаНазвание файла изображения с наложенными блоками (без расширения). По умолчанию создается файл с расширением *.png. Для сохранения файла также нужно заполнить поле "Путь к папке"
C:\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
Если значение "true", и в указанной папке существует файл изображения с таким же именем и расширением, то новый файл его перезапишет. Если "false", файл перезаписан не будет и действие вернет ошибку
.Robin.Booleantrue
Нет
No
Результаты
Results
ТекстТекст, извлеченный из исходного изображения
TextThe text extracted from the source file.Robin.String
Изображение с блоками


Image pathThe path to the image file with superimposed blocks
Путь к файлу изображения с наложенными блоками
.Robin.FilePath
Точность распознаванияТочность распознанного изображения в диапазоне от 0 до


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:

Image Added

Example of use

Task

Recognize license plate number from the image

Image Added

Solution

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

Implementation

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

Result

The program robot completed successfully. 

Image Added

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

Image Added

...

Робот НЕ вернет ошибку, вернет пустой результат, если:

  • на изображении не найден текст.
  • текст не распознан, так как он написан не четко или неправильно выбран язык текста

Пример распознавания

Текст: y9060098

Точность распознавания: 0,996

Изображение с блоками:

Image Removed

Пример использования 

Задача: распознать номер автомобиля с изображения 

Image Removed

Решение: воспользоваться действиями "Создать контекст", "Извлечь текст с изображения". 

Реализация:

  1. Собрать схему робота, состоящую из действий:
    Image Removed
  2. Настроить параметр действия "Создать контекст". 
    Image Removed
  3. Настроить параметры действия "Извлечь текст с изображения". 
    Image Removed
  4. Нажать на кнопку "Старт" в верхней панели. 

Результат:

Программный робот отработал успешно. 

Image Removed

Номер авто распознан. Файл с наложенными блоками сохранен в указанную папку. 

Image Removed