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

Ключ

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

...

Find documents in a file

...

Version 4 (Python)

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

Действие ищет в исходном файле различные типы документов и сохраняет их в виде отдельных файлов. Работает с первым разворотом паспорта, пропиской и СНИЛС. При необходимости ориентация документов будет исправлена.

Image Removed

Настройки

...

Примечание
The action is obsolete. It can be replaced by the action "Find documents in a file Dbrain OCR".

Description

The action searches for different types of documents in the source file and saves them as separate files. If necessary, orientation of documents will be corrected.

Action icon

Image Added

Parameters and their settings

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
File pathThe path to the file from which you want to get individual documents. Supported formats

Свойство

Описание

Тип

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

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

Параметры

Путь к файлу

Путь к файлу, из которого нужно получить отдельные документы. Поддерживаемые форматы
: jpg, jpeg, bmp, png, pdf.Robin.FilePath

Да

Путь к папке

Путь к папке, в которую будут сохранены изображения найденных документов. Изображения будут созданы с расширением *.png, а их имена будут содержать название типа соответствующего документа. Если поле не заполнено, то изображения сохранятся в папку исходного файла

Yes
Folder pathThe path to the folder where the images of the found documents will be saved. The images will be created with the *.png extension, and their names will contain the name of the type of the corresponding document. If the field is not filled in, the images will be saved to the source file folder.Robin.FolderPathC:\doc\img
Нет
No
Перезаписать
Overwrite
Если «true», и в указанной папке существует изображение с таким же именем и расширением, то новое изображение его перезапишет. Если «false», то изображение перезаписано не будет и действие вернет ошибку
If «true», and there are images with the same name and extension in the specified folder, then the new image will overwrite it. If «false», the image will not be overwritten and the action will return an error.Robin.Booleantrue

Нет

Добавить исходное название

Если «true», то имя каждого изображения будет содержать имя исходного файла и название типа документа, указанного на изображении. Если «false», то имена изображений будут содержать только названия типов документов
No
Add the source file to the nameIf «true», then the name of each image will contain the name of the source file and the name of the document type specified in the image. If «false», then the image names will contain only the names of document types.Robin.Booleantrue
Нет
No
Результаты
Results

Результат

Коллекция путей к изображениям документов, которые были найдены в исходном файле. Если найдено несколько документов одного типа, к названиям их изображений будет добавлен индекс
ResultA collection of paths to document images that were found in the source file. If several documents of the same type are found, an index will be added to the names of their images.Robin.Collection

Особые условия использования 

Робот вернет ошибку, если:

  • в поле "Путь к файлу" подается недопустимый формат входного файла.
  • по указанному пути уже есть файл с указанным именем и поле "перезаписать" = false.

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

  • на изображении нет документов, на которые нейросеть обучена делить документ (паспорт 2-3 стр, паспорт прописка, СНИЛС)

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

Задача: имеется скан паспорта и снилса, необходимо сохранить каждый документ, как отдельный файл. 

Image Removed

Решение: воспользоваться действием "Найти документы в файле". 

Реализация:

...



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

The robot will NOT return an error, it will return an empty result if:

  • there are no documents in the image, into which the neural network is trained to divide the document (passport 2-3 pages, registration in a passport, personal insurance policy number (SNILS))

Example of use 

Task

There is a scan of passport and SNILS, it is necessary to save each document as a separate file. 

Image Added

Solution

Use the "Find documents in a file" action.  

Implementation

  1. Move the "Find documents in a file" action to the workspace.
    Image Added
  2. Set the parameters of the "Find documents in a file" action.
    Image Added
  3. Click on the "Start" button in the top panel.


Result

The program robot completed successfully.

Image Added

 

2 images (passport and SNILS) are saved to the required folder.

Image Added

...

Результат:

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

Image Removed

В требуемую папку сохранены 2 изображения (паспорт и СНИЛС). 

Image Removed