OcrInput

OcrInput class

Module: models

Main class to collect images.

Constructors

NameDescription
initConstructor to create container and set the type of images / documents and filters for further processing / recognition.

Methods

NameReturn TypeStaticDescription
addNoAdd the path or URI containing the image for recognition / processing. The type of the image must correspond to the type specified in the constructor.
add_base64NoAdd the base64 string containing the image for recognition / processing. The type of the image must correspond to the type specified in the constructor.
addStreamNoAdd the InputStream containing the image for recognition / processing. The type of the image must correspond to the type specified in the constructor.
clearNoSet the amount of items for processing / recognition as 0. Clear the collection.
clear_filtersNoRemove all filters.
getImageDataNoReturns information about processed / recognized image.
getJavaClassNo
initNo
sizeNoAmount of items for processing / recognition.

OcrInput Constructor

__init__(self, InputType type, PreprocessingFilter filters)

Constructor to create container and set the type of images / documents and filters for further processing / recognition.

ParameterTypeDescription
typeInputTypeSet the images/documents type will be added to container.
filtersPreprocessingFilterSet processing filters will be applied for further processing or recognition.

OcrInput.add

add(self, str fullPath, int startPage, int pagesNumber)

Add the path or URI containing the image for recognition / processing. The type of the image must correspond to the type specified in the constructor.

ParameterTypeDescription
fullPathstrPath to the image/ document / folder / archive.
startPageintThe first page/image for processing / recognition. Use for documents, zip, folders.
pagesNumberintThe total amount of pages/images for processing / recognition. Use for documents, zip, folders. Default = all.

OcrInput.add_base64

add_base64(self, str base64)

Add the base64 string containing the image for recognition / processing. The type of the image must correspond to the type specified in the constructor.

ParameterTypeDescription
base64strBase64 string with single image.

OcrInput.addStream

addStream(self, image_data_binary, int startPage, int pagesNumber)

Add the InputStream containing the image for recognition / processing. The type of the image must correspond to the type specified in the constructor.

ParameterTypeDescription
image_data_binary``containing the image or document.
startPageintThe first page/image for processing / recognition. Use for documents, zip, folders.
pagesNumberintThe total amount of pages/images for processing / recognition. Use for documents, zip, folders. Default = all.

OcrInput.clear

clear(self)

Set the amount of items for processing / recognition as 0. Clear the collection.

OcrInput.clear_filters

clear_filters(self)

Remove all filters.

OcrInput.get

get(self, int index) -> ImageData

Returns information about processed / recognized image.

ParameterTypeDescription
indexintPosition of the image in the List.

Return Type: ImageData — The object of ImageData.

OcrInput.getJavaClass

getJavaClass(self)

OcrInput.init

init(self, javaClass)
ParameterTypeDescription
javaClass``

OcrInput.size

size(self)

Amount of items for processing / recognition.