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

Ключ

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

...

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


...

Settings

Свойство
Property
Описание
Description
Тип
Type
Пример заполнения
Filling example
Обязательность
Mandatory 
заполнения поля
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
НетПуть к папкеПуть к папке, в которую будет сохранено распознанное изображение с наложенными блоками, на которые действие разделило данные. Для сохранения файла также нужно заполнить поле "Имя файла".Robin.FolderPathНетИмя файлаНазвание файла изображения с наложенными блоками (без расширения). По умолчанию создается файл с расширением *.png. Для сохранения файла также нужно заполнить поле "Путь к папке"

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
Если значение "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

...

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

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

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

Текст: y9060098

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

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

Image Removed

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

Задача

Распознать номер автомобиля с изображения

Image Removed

Решение

Воспользоваться действиями "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