|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.tess4j.TessDllAPI1 net.sourceforge.tess4j.Tesseract1
public class Tesseract1
An object layer on top of TessDllAPI1
, provides character recognition support for common image formats, and multi-page TIFF images beyond the uncompressed,
binary TIFF format supported by Tesseract OCR engine. The extended capabilities are provided by the Java Advanced Imaging Image I/O Tools
.
Support for PDF documents is available through Ghost4J
, a JNA
wrapper for GPL Ghostscript
, which should be installed and included in system path.
Any program that uses the library will need to ensure that the required libraries (the .jar
files for jna
, jai-imageio
, and ghost4j
) are in its compile and run-time classpath
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.sourceforge.tess4j.TessDllAPI1 |
---|
TessDllAPI1.CANCEL_FUNC |
Nested classes/interfaces inherited from interface com.sun.jna.Library |
---|
com.sun.jna.Library.Handler |
Field Summary |
---|
Fields inherited from class net.sourceforge.tess4j.TessDllAPI1 |
---|
LIB_NAME |
Fields inherited from interface com.sun.jna.Library |
---|
OPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_STRUCTURE_ALIGNMENT, OPTION_TYPE_MAPPER |
Constructor Summary | |
---|---|
Tesseract1()
|
Method Summary | |
---|---|
java.lang.String |
doOCR(java.awt.image.BufferedImage bi)
Performs OCR operation. |
java.lang.String |
doOCR(java.awt.image.BufferedImage bi,
java.awt.Rectangle rect)
Performs OCR operation. |
java.lang.String |
doOCR(java.io.File imageFile)
Performs OCR operation. |
java.lang.String |
doOCR(java.io.File imageFile,
java.awt.Rectangle rect)
Performs OCR operation. |
java.lang.String |
doOCR(int xsize,
int ysize,
java.nio.ByteBuffer buf,
java.awt.Rectangle rect,
int bpp)
Performs OCR operation. |
java.lang.String |
doOCR(java.util.List<javax.imageio.IIOImage> imageList,
java.awt.Rectangle rect)
Performs OCR operation. |
void |
setLanguage(java.lang.String language)
Sets language for OCR. |
static byte[] |
wrapperListToByteArray(java.util.List<java.lang.Byte> list)
A utility method to convert a generic Byte list to a byte array. |
Methods inherited from class net.sourceforge.tess4j.TessDllAPI1 |
---|
TessDllBeginPage, TessDllBeginPageBPP, TessDllBeginPageLang, TessDllBeginPageLangBPP, TessDllBeginPageUpright, TessDllBeginPageUprightBPP, TessDllEndPage, TessDllRecognize_a_Block, TessDllRecognize_all_Words, TessDllRelease |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Tesseract1()
Method Detail |
---|
public void setLanguage(java.lang.String language)
language
- the language code, which follows ISO 639-3 standard.public java.lang.String doOCR(java.io.File imageFile) throws TesseractException
imageFile
- an image file
TesseractException
public java.lang.String doOCR(java.io.File imageFile, java.awt.Rectangle rect) throws TesseractException
imageFile
- an image filerect
- the bounding rectangle defines the region of the image to be recognized. A rectangle of zero dimension or null
indicates the whole image.
TesseractException
public java.lang.String doOCR(java.awt.image.BufferedImage bi) throws TesseractException
bi
- a buffered image
TesseractException
public java.lang.String doOCR(java.awt.image.BufferedImage bi, java.awt.Rectangle rect) throws TesseractException
bi
- a buffered imagerect
- the bounding rectangle defines the region of the image to be recognized. A rectangle of zero dimension or null
indicates the whole image.
TesseractException
public java.lang.String doOCR(java.util.List<javax.imageio.IIOImage> imageList, java.awt.Rectangle rect) throws TesseractException
imageList
- a list of IIOImage
objectsrect
- the bounding rectangle defines the region of the image to be recognized. A rectangle of zero dimension or null
indicates the whole image.
TesseractException
public java.lang.String doOCR(int xsize, int ysize, java.nio.ByteBuffer buf, java.awt.Rectangle rect, int bpp) throws TesseractException
xsize
- width of imageysize
- height of imagebuf
- pixel datarect
- the bounding rectangle defines the region of the image to be recognized. A rectangle of zero dimension or null
indicates the whole image.bpp
- bits per pixel, represents the bit depth of the image, with 1 for binary bitmap, 8 for gray, and 24 for color RGB.
TesseractException
public static byte[] wrapperListToByteArray(java.util.List<java.lang.Byte> list)
list
- a List
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |