Class OcrConfig
-
- All Implemented Interfaces:
-
java.io.Serializable
public class OcrConfig implements Serializable
Configuration for general OCR scanning use-cases
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumOcrConfig.ScanModeSets whether to scan single-line texts, multi-line texts in a grid-formation or finds text automatically.
-
Field Summary
Fields Modifier and Type Field Description public OcrConfig.ScanModescanModepublic List<String>modelspublic StringcustomCmdFilepublic IntegerminSharpnesspublic IntegercharCountXpublic IntegercharCountYpublic DoublecharPaddingXFactorpublic DoublecharPaddingYFactorpublic IntegerminConfidencepublic IntegerminCharHeightpublic IntegermaxCharHeightpublic StringvalidationRegexpublic StringcharWhitelist
-
Constructor Summary
Constructors Constructor Description OcrConfig()
-
Method Summary
Modifier and Type Method Description OcrConfig.ScanModegetScanMode()Sets whether to scan single-line texts, multi-line texts in a grid-formation or finds text automatically. voidsetScanMode(OcrConfig.ScanMode scanMode)Sets whether to scan single-line texts, multi-line texts in a grid-formation or finds text automatically. List<String>getModels()Sets one or more custom Anyline models. voidsetModels(List<String> models)Sets one or more custom Anyline models. StringgetCustomCmdFile()Sets a custom Anyline script. voidsetCustomCmdFile(String customCmdFile)Sets a custom Anyline script. IntegergetMinSharpness()Sets a sharpnes factor (0-100) to rule out blurry images. voidsetMinSharpness(Integer minSharpness)Sets a sharpnes factor (0-100) to rule out blurry images. IntegergetCharCountX()Sets the number of characters in each text line for 'grid' mode. voidsetCharCountX(Integer charCountX)Sets the number of characters in each text line for 'grid' mode. IntegergetCharCountY()Sets the number of text lines for 'grid' mode. voidsetCharCountY(Integer charCountY)Sets the number of text lines for 'grid' mode. DoublegetCharPaddingXFactor()Defines the average horizontal distance between two characters in 'grid' mode, measured in percentage of the characters width. voidsetCharPaddingXFactor(Double charPaddingXFactor)Defines the average horizontal distance between two characters in 'grid' mode, measured in percentage of the characters width. DoublegetCharPaddingYFactor()Defines the average vertical distance between two characters in 'grid' mode, measured in percentage of the characters height. voidsetCharPaddingYFactor(Double charPaddingYFactor)Defines the average vertical distance between two characters in 'grid' mode, measured in percentage of the characters height. IntegergetMinConfidence()Sets a minimum confidence which has to be reached in order to trigger a scan result. voidsetMinConfidence(Integer minConfidence)Sets a minimum confidence which has to be reached in order to trigger a scan result. IntegergetMinCharHeight()Sets a minimum character height (in pixels) to be considered in the scanning process. voidsetMinCharHeight(Integer minCharHeight)Sets a minimum character height (in pixels) to be considered in the scanning process. IntegergetMaxCharHeight()Sets a maximum character height (in pixels) to be considered in the scanning process. voidsetMaxCharHeight(Integer maxCharHeight)Sets a maximum character height (in pixels) to be considered in the scanning process. StringgetValidationRegex()Sets a regular expression which the scanned text needs to match in order to trigger a scan result. voidsetValidationRegex(String validationRegex)Sets a regular expression which the scanned text needs to match in order to trigger a scan result. StringgetCharWhitelist()Restricts the scanner to a set of characters to be detected. voidsetCharWhitelist(String charWhitelist)Restricts the scanner to a set of characters to be detected. StringtoString()inthashCode()booleanequals(Object other)-
-
Method Detail
-
getScanMode
OcrConfig.ScanMode getScanMode()
Sets whether to scan single-line texts, multi-line texts in a grid-formation or finds text automatically.
-
setScanMode
void setScanMode(OcrConfig.ScanMode scanMode)
Sets whether to scan single-line texts, multi-line texts in a grid-formation or finds text automatically.
-
getModels
List<String> getModels()
Sets one or more custom Anyline models. The files have to be located in the project and point to a path relative from the project root. If no customCmdFile is set, only a maximum of one model is valid. If a customCmdFile is set, it depends whether or not the customCmdFile requires multiple models or not. Please check the official documentation for more details.
-
setModels
void setModels(List<String> models)
Sets one or more custom Anyline models. The files have to be located in the project and point to a path relative from the project root. If no customCmdFile is set, only a maximum of one model is valid. If a customCmdFile is set, it depends whether or not the customCmdFile requires multiple models or not. Please check the official documentation for more details.
-
getCustomCmdFile
String getCustomCmdFile()
Sets a custom Anyline script. The file has to be located in the project and point to a path relative from the project root. Please check the official documentation for more details.
-
setCustomCmdFile
void setCustomCmdFile(String customCmdFile)
Sets a custom Anyline script. The file has to be located in the project and point to a path relative from the project root. Please check the official documentation for more details.
-
getMinSharpness
Integer getMinSharpness()
Sets a sharpnes factor (0-100) to rule out blurry images.
-
setMinSharpness
void setMinSharpness(Integer minSharpness)
Sets a sharpnes factor (0-100) to rule out blurry images.
-
getCharCountX
Integer getCharCountX()
Sets the number of characters in each text line for 'grid' mode.
-
setCharCountX
void setCharCountX(Integer charCountX)
Sets the number of characters in each text line for 'grid' mode.
-
getCharCountY
Integer getCharCountY()
Sets the number of text lines for 'grid' mode.
-
setCharCountY
void setCharCountY(Integer charCountY)
Sets the number of text lines for 'grid' mode.
-
getCharPaddingXFactor
Double getCharPaddingXFactor()
Defines the average horizontal distance between two characters in 'grid' mode, measured in percentage of the characters width.
-
setCharPaddingXFactor
void setCharPaddingXFactor(Double charPaddingXFactor)
Defines the average horizontal distance between two characters in 'grid' mode, measured in percentage of the characters width.
-
getCharPaddingYFactor
Double getCharPaddingYFactor()
Defines the average vertical distance between two characters in 'grid' mode, measured in percentage of the characters height.
-
setCharPaddingYFactor
void setCharPaddingYFactor(Double charPaddingYFactor)
Defines the average vertical distance between two characters in 'grid' mode, measured in percentage of the characters height.
-
getMinConfidence
Integer getMinConfidence()
Sets a minimum confidence which has to be reached in order to trigger a scan result.
-
setMinConfidence
void setMinConfidence(Integer minConfidence)
Sets a minimum confidence which has to be reached in order to trigger a scan result.
-
getMinCharHeight
Integer getMinCharHeight()
Sets a minimum character height (in pixels) to be considered in the scanning process.
-
setMinCharHeight
void setMinCharHeight(Integer minCharHeight)
Sets a minimum character height (in pixels) to be considered in the scanning process.
-
getMaxCharHeight
Integer getMaxCharHeight()
Sets a maximum character height (in pixels) to be considered in the scanning process.
-
setMaxCharHeight
void setMaxCharHeight(Integer maxCharHeight)
Sets a maximum character height (in pixels) to be considered in the scanning process.
-
getValidationRegex
String getValidationRegex()
Sets a regular expression which the scanned text needs to match in order to trigger a scan result.
-
setValidationRegex
void setValidationRegex(String validationRegex)
Sets a regular expression which the scanned text needs to match in order to trigger a scan result.
-
getCharWhitelist
String getCharWhitelist()
Restricts the scanner to a set of characters to be detected.
-
setCharWhitelist
void setCharWhitelist(String charWhitelist)
Restricts the scanner to a set of characters to be detected.
-
hashCode
int hashCode()
-
-
-
-