public interface ITesseract
Modifier and Type | Interface and Description |
---|---|
static class |
ITesseract.RenderedFormat
Rendered formats supported by Tesseract.
|
Modifier and Type | Field and Description |
---|---|
static String |
htmlBeginTag |
static String |
htmlEndTag |
Modifier and Type | Method and Description |
---|---|
void |
createDocuments(String[] filenames,
String[] outputbases,
List<ITesseract.RenderedFormat> formats)
Creates documents for given renderers.
|
void |
createDocuments(String filename,
String outputbase,
List<ITesseract.RenderedFormat> formats)
Creates documents for given renderers.
|
String |
doOCR(BufferedImage bi)
Performs OCR operation.
|
String |
doOCR(BufferedImage bi,
Rectangle rect)
Performs OCR operation.
|
String |
doOCR(File imageFile)
Performs OCR operation.
|
String |
doOCR(File imageFile,
Rectangle rect)
Performs OCR operation.
|
String |
doOCR(int xsize,
int ysize,
ByteBuffer buf,
Rectangle rect,
int bpp)
Performs OCR operation.
|
String |
doOCR(int xsize,
int ysize,
ByteBuffer buf,
String filename,
Rectangle rect,
int bpp)
Performs OCR operation.
|
String |
doOCR(List<IIOImage> imageList,
Rectangle rect)
Performs OCR operation.
|
String |
doOCR(List<IIOImage> imageList,
String filename,
Rectangle rect)
Performs OCR operation.
|
List<Rectangle> |
getSegmentedRegions(BufferedImage bi,
int pageIteratorLevel)
Gets segmented regions at specified page iterator level.
|
List<Word> |
getWords(BufferedImage bi,
int pageIteratorLevel)
Gets recognized words at specified page iterator level.
|
void |
setConfigs(List<String> configs)
Sets configs to be passed to Tesseract's
Init method. |
void |
setDatapath(String datapath)
Sets tessdata path.
|
void |
setLanguage(String language)
Sets language for OCR.
|
void |
setOcrEngineMode(int ocrEngineMode)
Sets OCR engine mode.
|
void |
setPageSegMode(int mode)
Sets page segmentation mode.
|
void |
setTessVariable(String key,
String value)
Sets the value of Tesseract's internal parameter.
|
static final String htmlBeginTag
static final String htmlEndTag
String doOCR(File imageFile) throws TesseractException
imageFile
- an image fileTesseractException
String doOCR(File imageFile, 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
String doOCR(BufferedImage bi) throws TesseractException
bi
- a buffered imageTesseractException
String doOCR(BufferedImage bi, 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
String doOCR(List<IIOImage> imageList, 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
String doOCR(List<IIOImage> imageList, String filename, Rectangle rect) throws TesseractException
imageList
- a list of IIOImage
objectsfilename
- input file name. Needed only for training and reading a
UNLV zone file.rect
- the bounding rectangle defines the region of the image to be
recognized. A rectangle of zero dimension or null
indicates
the whole image.TesseractException
String doOCR(int xsize, int ysize, ByteBuffer buf, Rectangle rect, int bpp) throws TesseractException
SetImage
, (optionally)
SetRectangle
, and one or more of the Get*Text
functions.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
String doOCR(int xsize, int ysize, ByteBuffer buf, String filename, Rectangle rect, int bpp) throws TesseractException
SetImage
, (optionally)
SetRectangle
, and one or more of the Get*Text
functions.xsize
- width of imageysize
- height of imagebuf
- pixel datafilename
- input file name. Needed only for training and reading a
UNLV zone file.rect
- 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
void setDatapath(String datapath)
datapath
- the tessdata path to setvoid setLanguage(String language)
language
- the language code, which follows ISO 639-3 standard.void setOcrEngineMode(int ocrEngineMode)
ocrEngineMode
- the OcrEngineMode to setvoid setPageSegMode(int mode)
mode
- the page segmentation mode to setvoid setTessVariable(String key, String value)
key
- variable name, e.g., tessedit_create_hocr
,
tessedit_char_whitelist
, etc.value
- value for corresponding variable, e.g., "1", "0",
"0123456789", etc.void setConfigs(List<String> configs)
Init
method.configs
- list of config filenames, e.g., "digits", "bazaar",
"quiet"void createDocuments(String filename, String outputbase, List<ITesseract.RenderedFormat> formats) throws TesseractException
filename
- input imageoutputbase
- output filename without extensionformats
- types of renderersTesseractException
void createDocuments(String[] filenames, String[] outputbases, List<ITesseract.RenderedFormat> formats) throws TesseractException
filenames
- array of input filesoutputbases
- array of output filenames without extensionformats
- types of renderersTesseractException
List<Rectangle> getSegmentedRegions(BufferedImage bi, int pageIteratorLevel) throws TesseractException
bi
- input imagepageIteratorLevel
- TessPageIteratorLevel enumRectangle
TesseractException
List<Word> getWords(BufferedImage bi, int pageIteratorLevel)
bi
- input imagepageIteratorLevel
- TessPageIteratorLevel enumWord
Copyright © 2017 Tess4J. All Rights Reserved.