Class OCRParams
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()The names of candidate fonts for placing text under an image.Get the configuration parameters.booleanGet the image preprocessing enable state. True if any image preprocessing is on.The engine in use.The list of languages to use.The page segmentation mode.The desired engine performance.doubleEach image will use this resolution by default.static StringSpecify the Tesseract v4 engine. Pass this to the engine property.voidsetCandidateFontNames(List<String> candidateFontNames) The names of candidate fonts for placing text under an image.voidsetConfigurationParameters(Map<String, String> configurationParameters) Set the configuration parameters.voidsetEnableImagePreprocessing(boolean enable) Enable all image preprocessing, default enabled. Note that once the OCREngine is initialized, this setting is permanent.voidThe engine in use.voidsetLanguages(List<LanguageSetting> languages) The list of languages to use.voidThe page segmentation mode.voidsetPerformance(Performance performance) The desired engine performance.voidsetResolution(double resolution) Each image will use this resolution by default.
-
Constructor Details
-
OCRParams
public OCRParams()Create an OCRParams structure with defaults.
-
-
Method Details
-
delete
public void delete() -
getTesseract4Engine
Specify the Tesseract v4 engine. Pass this to the engine property. -
getResolution
public double getResolution()Each image will use this resolution by default. -
setResolution
public void setResolution(double resolution) Each image will use this resolution by default. -
getPageSegmentationMode
The page segmentation mode. -
setPageSegmentationMode
The page segmentation mode. -
getPerformance
The desired engine performance. -
setPerformance
The desired engine performance. -
getEngine
The engine in use. -
setEngine
The engine in use. -
getLanguages
The list of languages to use. -
setLanguages
The list of languages to use. -
getCandidateFontNames
The names of candidate fonts for placing text under an image. The default list should work well in most cases. If you're using text that isn't represented by Latin fonts, or by Chinese, Japanese, or Korean fonts, then retrieve this list, add the font that can represent that text, then set that new list on this object.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.
-
setCandidateFontNames
The names of candidate fonts for placing text under an image. The default list should work well in most cases. If you're using text that isn't represented by Latin fonts, or by Chinese, Japanese, or Korean fonts, then retrieve this list, add the font that can represent that text, then set that new list on this object.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.
-
setEnableImagePreprocessing
public void setEnableImagePreprocessing(boolean enable) Enable all image preprocessing, default enabled. Note that once the OCREngine is initialized, this setting is permanent. -
getEnableImagePreprocessing
public boolean getEnableImagePreprocessing()Get the image preprocessing enable state. True if any image preprocessing is on. -
getConfigurationParameters
Get the configuration parameters. Note: Reserved for internal use. Do not use unless directed to by Datalogics Support. -
setConfigurationParameters
Set the configuration parameters. Note: Reserved for internal use. Do not use unless directed to by Datalogics Support.
-