public class OCRParams
extends java.lang.Object
| Constructor and Description |
|---|
OCRParams()
Create an OCRParams structure with defaults.
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete() |
java.util.List<java.lang.String> |
getCandidateFontNames()
The names of candidate fonts for placing text under an image.
|
java.util.Map<java.lang.String,java.lang.String> |
getConfigurationParameters()
Get the configuration parameters.
|
boolean |
getEnableImagePreprocessing()
Get the image preprocessing enable state. True if any image preprocessing is on.
|
java.lang.String |
getEngine()
The engine in use.
|
java.util.List<LanguageSetting> |
getLanguages()
The list of languages to use.
|
PageSegmentationMode |
getPageSegmentationMode()
The page segmentation mode.
|
Performance |
getPerformance()
The desired engine performance.
|
double |
getResolution()
Each image will use this resolution by default.
|
static java.lang.String |
getTesseract4Engine()
Specify the Tesseract v4 engine. Pass this to the engine property.
|
void |
setCandidateFontNames(java.util.List<java.lang.String> candidateFontNames)
The names of candidate fonts for placing text under an image.
|
void |
setConfigurationParameters(java.util.Map<java.lang.String,java.lang.String> configurationParameters)
Set the configuration parameters.
|
void |
setEnableImagePreprocessing(boolean enable)
Enable all image preprocessing, default enabled. Note that once the OCREngine is initialized, this setting is permanent.
|
void |
setEngine(java.lang.String engine)
The engine in use.
|
void |
setLanguages(java.util.List<LanguageSetting> languages)
The list of languages to use.
|
void |
setPageSegmentationMode(PageSegmentationMode mode)
The page segmentation mode.
|
void |
setPerformance(Performance performance)
The desired engine performance.
|
void |
setResolution(double resolution)
Each image will use this resolution by default.
|
public void delete()
public static java.lang.String getTesseract4Engine()
public double getResolution()
public void setResolution(double resolution)
public PageSegmentationMode getPageSegmentationMode()
public void setPageSegmentationMode(PageSegmentationMode mode)
public Performance getPerformance()
public void setPerformance(Performance performance)
public java.lang.String getEngine()
public void setEngine(java.lang.String engine)
public java.util.List<LanguageSetting> getLanguages()
public void setLanguages(java.util.List<LanguageSetting> languages)
public java.util.List<java.lang.String> getCandidateFontNames()
Enough font names must be supplied to cover the expected languages/scripts in use.
The code selects a font to represent each word. If a word code-switches between different scripts, for instance, if it contains non-Latin text and Arabic numerals, then make sure to supply the name of a font family that can handle both the text and the numerals.
The quality of the results depends on the font choice. The list is searched in order until a font works for a particular word. To make the text fit better, it's recommended to list proportional fonts before fixed-width fonts. Decorative fonts with flourishes, like Zapf Chancery, deliver poor results. Generally, supply a font that would be used in block text, such as in a newspaper or work of literature, such as Times Roman, or a font already in the list, like MinionPro.
If the PlaceTextUnder method in OCREngine can't identify a font that covers the whole text of a word, an exception will be thrown.
public void setCandidateFontNames(java.util.List<java.lang.String> candidateFontNames)
Enough font names must be supplied to cover the expected languages/scripts in use.
The code selects a font to represent each word. If a word code-switches between different scripts, for instance, if it contains non-Latin text and Arabic numerals, then make sure to supply the name of a font family that can handle both the text and the numerals.
The quality of the results depends on the font choice. The list is searched in order until a font works for a particular word. To make the text fit better, it's recommended to list proportional fonts before fixed-width fonts. Decorative fonts with flourishes, like Zapf Chancery, deliver poor results. Generally, supply a font that would be used in block text, such as in a newspaper or work of literature, such as Times Roman, or a font already in the list, like MinionPro.
If the PlaceTextUnder method in OCREngine can't identify a font that covers the whole text of a word, an exception will be thrown.
public void setEnableImagePreprocessing(boolean enable)
public boolean getEnableImagePreprocessing()
public java.util.Map<java.lang.String,java.lang.String> getConfigurationParameters()
public void setConfigurationParameters(java.util.Map<java.lang.String,java.lang.String> configurationParameters)