OcrInput

Inheritance: java.lang.Object

All Implemented Interfaces: java.lang.Iterable

public class OcrInput implements Iterable<ImageData>

Main class for recognize text from images.

Constructors

ConstructorDescription
OcrInput(InputType type, PreprocessingFilter filters)Constructor to create container and set the type of images / documents and filters for further processing / recognition.
OcrInput(InputType type)

Methods

MethodDescription
add(int[] pixels, int width, int height, int bitsPerPixel)Add the decoded image to the list for recognition / processing.
add(BufferedImage image)Add the BufferedImage containing the image for recognition / processing.
add(BufferedImage image, int startPage, int pagesCount)Add the BufferedImage containing the multipage image for recognition / processing.
add(InputStream stream)Add the InputStream containing the image for recognition / processing.
add(InputStream stream, int startPage, int pagesCount)Add the InputStream containing the multipage image for recognition / processing.
add(String fullPath)Add the path or URI containing the image for recognition / processing.
add(String fullPath, int startPage, int pagesCount)Add the multipage images / documents for recognition / processing.
addBase64(String base64)Add the base64 string containing the image for recognition / processing.
clear()Set the amount of items for processing / recognition as 0.
clearFilters()Remove all filters.
equals(Object arg0)
get(int index)Returns information about processed / recognized image.
getClass()
hashCode()
iterator()
notify()
notifyAll()
replaceFilters(PreprocessingFilter filters)Remove old filters and set new.
size()Amount of items for processing / recognition.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

OcrInput(InputType type, PreprocessingFilter filters)

public OcrInput(InputType type, PreprocessingFilter filters)

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

Parameters:

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

OcrInput(InputType type)

public OcrInput(InputType type)

Parameters:

ParameterTypeDescription
typeInputType

add(int[] pixels, int width, int height, int bitsPerPixel)

public void add(int[] pixels, int width, int height, int bitsPerPixel)

Add the decoded image to the list for recognition / processing. The type of the image must correspond to the type specified in the constructor (SingleImage).

Parameters:

ParameterTypeDescription
pixelsint[]The pixels are represented as 32-bit integer values (rgb).
widthintImage width.
heightintImage height.
bitsPerPixelintSupports 1-32 bits.

add(BufferedImage image)

public void add(BufferedImage image)

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

Parameters:

ParameterTypeDescription
imagejava.awt.image.BufferedImageBufferedImage containing the image or document.

add(BufferedImage image, int startPage, int pagesCount)

public void add(BufferedImage image, int startPage, int pagesCount)

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

Parameters:

ParameterTypeDescription
imagejava.awt.image.BufferedImageBufferedImage containing the multipage document.
startPageintThe first page/image for processing / recognition. Use for documents.
pagesCountintThe total amount of pages/images for processing / recognition. Use for documents. Default = all.

add(InputStream stream)

public void add(InputStream stream)

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

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamInputStream containing the image or document.

add(InputStream stream, int startPage, int pagesCount)

public void add(InputStream stream, int startPage, int pagesCount)

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

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamInputStream containing the multipage document.
startPageintThe first page/image for processing / recognition. Use for documents.
pagesCountintThe total amount of pages/images for processing / recognition. Use for documents. Default = all.

add(String fullPath)

public void add(String fullPath)

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:

ParameterTypeDescription
fullPathjava.lang.StringPath to the image/ document / folder / archive.

add(String fullPath, int startPage, int pagesCount)

public void add(String fullPath, int startPage, int pagesCount)

Add the multipage images / documents for recognition / processing. The type of the image must correspond to the type specified in the constructor.

Parameters:

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

addBase64(String base64)

public void addBase64(String 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:

ParameterTypeDescription
base64java.lang.StringBase64 string with single image.

clear()

public void clear()

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

clearFilters()

public void clearFilters()

Remove all filters.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

get(int index)

public ImageData get(int index)

Returns information about processed / recognized image.

Parameters:

ParameterTypeDescription
indexintPosition of the image in the List.

Returns: ImageData - The object of @see ImageData

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

hashCode()

public native int hashCode()

Returns: int

iterator()

public Iterator<ImageData> iterator()

Returns: java.util.Iterator<com.aspose.ocr.ImageData>

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

replaceFilters(PreprocessingFilter filters)

public void replaceFilters(PreprocessingFilter filters)

Remove old filters and set new.

Parameters:

ParameterTypeDescription
filtersPreprocessingFilterProcessing filters will be applied for further processing or recognition.

size()

public int size()

Amount of items for processing / recognition.

Returns: int - Amount of items.

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int