Aspose.OCR for Python via Java API docs
Loading...
Searching...
No Matches

Main class to collect images. More...

Public Member Functions

 __init__ (self, InputType type, PreprocessingFilter filters=None)
 Constructor to create container and set the type of images / documents and filters for further processing / recognition.
 
 add (self, str fullPath, int startPage=None, int pagesNumber=None)
 Add the path or URI containing the image for recognition / processing.
 
 add_base64 (self, str base64)
 Add the base64 string containing the image for recognition / processing.
 
 addStream (self, image_data_binary, int startPage=None, int pagesNumber=None)
 Add the InputStream containing the image for recognition / processing.
 
 clear (self)
 Set the amount of items for processing / recognition as 0.
 
 clear_filters (self)
 Remove all filters.
 
ImageData get (self, int index)
 Returns information about processed / recognized image.
 
 getJavaClass (self)
 
 init (self, javaClass)
 
 size (self)
 Amount of items for processing / recognition.
 

Public Attributes

 source
 
 type
 

Detailed Description

Main class to collect images.

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self,
InputType  type,
PreprocessingFilter   filters = None 
)

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

Parameters
typeSet the images/documents type will be added to container.
filtersSet processing filters will be applied for further processing or recognition.

Member Function Documentation

◆ add()

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

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.

Parameters
fullPathPath to the image/ document / folder / archive.
startPageThe first page/image for processing / recognition. Use for documents, zip, folders.
pagesNumberThe total amount of pages/images for processing / recognition. Use for documents, zip, folders. Default = all.

◆ 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.

Parameters
base64Base64 string with single image.

◆ addStream()

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

Add the InputStream containing the image for recognition / processing.

The type of the image must correspond to the type specified in the constructor.

input = OcrInput(InputType.SINGLE_IMAGE)
file = open(imgPath, "rb")
image_data_binary = file.read()
file.close()
input.addStream(image_data_binary)
result = api.recognize(input, RecognitionSettings())
Parameters
image_data_binarycontaining the image or document.
startPageThe first page/image for processing / recognition. Use for documents, zip, folders.
pagesNumberThe total amount of pages/images for processing / recognition. Use for documents, zip, folders. Default = all.

◆ clear()

clear (   self)

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

Clear the collection.

◆ clear_filters()

clear_filters (   self)

Remove all filters.

◆ get()

ImageData get (   self,
int  index 
)

Returns information about processed / recognized image.

Parameters
indexPosition of the image in the List.
Returns
: The object of ImageData.

◆ getJavaClass()

getJavaClass (   self)

◆ init()

init (   self,
  javaClass 
)

◆ size()

size (   self)

Amount of items for processing / recognition.

Returns
: Amount of items.

Member Data Documentation

◆ source

source

◆ type

type