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
Constructor | Description |
---|---|
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
Method | Description |
---|---|
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:
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(InputType type)
public OcrInput(InputType type)
Parameters:
Parameter | Type | Description |
---|---|---|
type | InputType |
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:
Parameter | Type | Description |
---|---|---|
pixels | int[] | The pixels are represented as 32-bit integer values (rgb). |
width | int | Image width. |
height | int | Image height. |
bitsPerPixel | int | Supports 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:
Parameter | Type | Description |
---|---|---|
image | java.awt.image.BufferedImage | BufferedImage 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:
Parameter | Type | Description |
---|---|---|
image | java.awt.image.BufferedImage | BufferedImage containing the multipage document. |
startPage | int | The first page/image for processing / recognition. Use for documents. |
pagesCount | int | The 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:
Parameter | Type | Description |
---|---|---|
stream | java.io.InputStream | InputStream 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:
Parameter | Type | Description |
---|---|---|
stream | java.io.InputStream | InputStream containing the multipage document. |
startPage | int | The first page/image for processing / recognition. Use for documents. |
pagesCount | int | The 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:
Parameter | Type | Description |
---|---|---|
fullPath | java.lang.String | Path 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:
Parameter | Type | Description |
---|---|---|
fullPath | java.lang.String | Path to the image/ document / folder / archive. |
startPage | int | The first page/image for processing / recognition. Use for documents, zip, folders. |
pagesCount | int | The 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:
Parameter | Type | Description |
---|---|---|
base64 | java.lang.String | Base64 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:
Parameter | Type | Description |
---|---|---|
arg0 | java.lang.Object |
Returns: boolean
get(int index)
public ImageData get(int index)
Returns information about processed / recognized image.
Parameters:
Parameter | Type | Description |
---|---|---|
index | int | Position 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:
Parameter | Type | Description |
---|---|---|
filters | PreprocessingFilter | Processing 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:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |