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

Ключ

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

Extract the car number from the image Version 3 (python)

...

Action group: Robin OCR

...

Description

The action allows you to extract the car number from the image. Recognition takes place 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 from which you want to extract the car number. The image must contain the machine number, otherwise the extracted data may be incorrect. Supported image formats: jpg, jpeg, bmp, dib, rle, jpe, jfif, tif, tiff, png.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
The car numberThe car number extracted from the original image.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

  • If an image without license plates or with several license plates is input, the text data from the image may be recognized incorrectly or not recognized at all. Therefore, it is recommended to use the action only for recognizing one license plate number;
  • acceptable image formats: jpg
  • если на вход подается изображение без автомобильных номеров или с несколькими номерами, то текстовые данные с изображения могут быть опознаны некорректно или не опознаны вовсе. Поэтому рекомендуется использовать действие только для опознания одного автомобильного номера;
  • допустимые форматы изображения: jpg, jpeg, bmp, dib, rle, jpe, jfif, gif, tif, tiff, png; 
  • если действие не найдет или не распознает номер, то робот завершится без ошибки;
  • если указан неверный номер страницы файла, то робот завершится с ошибкой;
  • если заполнено поле "Путь к папке" и не заполнено "Имя файла", то робот завершится с ошибкой;
  • если заполнено поле "Имя файла" и не заполнено "Путь к папке", то робот завершится с ошибкой;
  • если в параметре "Путь к папке" указана папка, где уже есть файл с указанным именем и параметр "Перезаписать" = false, то робот завершится с ошибкой;
  • если параметры "Путь к папке", "Имя файла" не заполнены, то файл с наложенными блоками не сохранится;
  • если параметры "Имя файла" и  "Путь к файлу" заполнены, то изображение с блоками сохраняется в указанной папке с указанным именем в формате .png.

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

Задача

Необходимо извлечь из изображения номер машины 

Image Removed

Решение

Воспользоваться действием "Создать контекст с Robin OCR 2", "Извлечь номер машины из изображения".

Реализация

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

Результат

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

ОШИБКА!!!
Image Removed
Image Removed
Изображение с блоками:

Image Removed

...

  • if the action does not find or recognize the number, the robot will terminate without error;
  • if an invalid file page number is specified, the robot will terminate with an error;
  • if the "Folder path" field is filled in and the "File name" field is not filled in, the robot will terminate with an error;
  • if the "File name" field is filled in and the "Folder path" field is not filled in, the robot will terminate with an error;
  • if the "Folder path" parameter specifies a folder where there is already a file with the specified name and the "Overwrite" parameter = false, the robot will terminate with an error;
  • if "Folder path" and "File name" parameters are not filled in, the file with superimposed blocks will not be saved;
  • if parameters "File name" and "File path" are filled in, the image with blocks will be saved in the specified folder with the specified name in .png format.

Example of use

Task

You need to extract the license plate number from the image 

Image Added

Solution

Use the action "Create context with Robin OCR 2", "Extract the car number from the image".

Implementation

  1. Assemble a robot scheme consisting of actions:
    Image Added
  2. Fill in the "Create context with Robin OCR 2" parameters according to the customization standards for this action.
    Image Added
  3. Set the parameters for the "Extract the car number from the image" action. To fill the context, click on Image Added, then click on Image Added and select the context of the action "Create context with Robin OCR 2 1" from the dropdown list.
    Image Added
  4. Click on the "Start" button in the top panel.

Result

The program robot completed successfully.Image Added
Image with blocks:

Image Added

Additional attachments

https://confluence.itbs.it.ru/x/9437Eg

Инструкция для локального подключения

Instructions for local connection

  1. Click "Start."
  2. Select "Settings
  3. Нажать "Пуск".
  4. Выбрать "Параметры".
    Выбрать
  5. Select "System"Система.
  6. Выбрать Select "О программеAbout".

  7. Выбрать "Дополнительные параметры системыSelect "Advanced system settings".

    В открывшемся окне выбрать "Переменные среды
  8. In the window that opens, select "Environment variables".
  9. Нажимаем Click "СоздатьCreate".

  10. ВводимEnter:

    Имя Name - ROBIN_PY_OCRENGINE_PATH

    Значение Value - http://10.68.10.31:8080/api/v1/ocr/gettext/abt

    и нажимаем and click "ОК".

  11. Перезагружаем компьютерRestart the computer.

  12. Подключаемся к нашему Connect to the vpn.

  13. Можно запускать робота.
  14. You can start the robot.