OcrInput
OcrInput class
Module: models
Main class to collect images.
Constructors
| Name | Description |
|---|---|
| init | Constructor to create container and set the type of images / documents and filters for further processing / recognition. |
Methods
| Name | Return Type | Static | Description |
|---|---|---|---|
| add | No | 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. | |
| add_base64 | No | Add the base64 string containing the image for recognition / processing. The type of the image must correspond to the type specified in the constructor. | |
| addStream | No | Add the InputStream containing the image for recognition / processing. The type of the image must correspond to the type specified in the constructor. | |
| clear | No | Set the amount of items for processing / recognition as 0. Clear the collection. | |
| clear_filters | No | Remove all filters. | |
| get | ImageData | No | Returns information about processed / recognized image. |
| getJavaClass | No | ||
| init | No | ||
| size | No | Amount 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.
| Parameter | Type | Description |
|---|---|---|
type | InputType | Set the images/documents type will be added to container. |
filters | PreprocessingFilter | Set 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.
| Parameter | Type | Description |
|---|---|---|
fullPath | str | Path to the image/ document / folder / archive. |
startPage | int | The first page/image for processing / recognition. Use for documents, zip, folders. |
pagesNumber | int | The 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.
| Parameter | Type | Description |
|---|---|---|
base64 | str | Base64 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.
| Parameter | Type | Description |
|---|---|---|
image_data_binary | `` | containing the image or document. |
startPage | int | The first page/image for processing / recognition. Use for documents, zip, folders. |
pagesNumber | int | The 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.
| Parameter | Type | Description |
|---|---|---|
index | int | Position of the image in the List. |
Return Type: ImageData — The object of ImageData.
OcrInput.getJavaClass
getJavaClass(self)
OcrInput.init
init(self, javaClass)
| Parameter | Type | Description |
|---|---|---|
javaClass | `` |
OcrInput.size
size(self)
Amount of items for processing / recognition.