Class OcrConfig
-
- All Implemented Interfaces:
public class OcrConfig
Configuration for general OCR scanning use-cases
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
OcrConfig.ScanMode
Sets 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.ScanMode
scanMode
public List<String>
models
public String
customCmdFile
public Integer
minSharpness
public Integer
charCountX
public Integer
charCountY
public Double
charPaddingXFactor
public Double
charPaddingYFactor
public Integer
minConfidence
public Integer
minCharHeight
public Integer
maxCharHeight
public String
validationRegex
public String
charWhitelist
-
Constructor Summary
Constructors Constructor Description OcrConfig()
-
Method Summary
Modifier and Type Method Description OcrConfig.ScanMode
getScanMode()
Sets whether to scan single-line texts, multi-line texts in a grid-formation or finds text automatically. void
setScanMode(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. void
setModels(List<String> models)
Sets one or more custom Anyline models. String
getCustomCmdFile()
Sets a custom Anyline script. void
setCustomCmdFile(String customCmdFile)
Sets a custom Anyline script. Integer
getMinSharpness()
Sets a sharpnes factor (0-100) to rule out blurry images. void
setMinSharpness(Integer minSharpness)
Sets a sharpnes factor (0-100) to rule out blurry images. Integer
getCharCountX()
Sets the number of characters in each text line for 'grid' mode. void
setCharCountX(Integer charCountX)
Sets the number of characters in each text line for 'grid' mode. Integer
getCharCountY()
Sets the number of text lines for 'grid' mode. void
setCharCountY(Integer charCountY)
Sets the number of text lines for 'grid' mode. Double
getCharPaddingXFactor()
Defines the average horizontal distance between two characters in 'grid' mode, measured in percentage of the characters width. void
setCharPaddingXFactor(Double charPaddingXFactor)
Defines the average horizontal distance between two characters in 'grid' mode, measured in percentage of the characters width. Double
getCharPaddingYFactor()
Defines the average vertical distance between two characters in 'grid' mode, measured in percentage of the characters height. void
setCharPaddingYFactor(Double charPaddingYFactor)
Defines the average vertical distance between two characters in 'grid' mode, measured in percentage of the characters height. Integer
getMinConfidence()
Sets a minimum confidence which has to be reached in order to trigger a scan result. void
setMinConfidence(Integer minConfidence)
Sets a minimum confidence which has to be reached in order to trigger a scan result. Integer
getMinCharHeight()
Sets a minimum character height (in pixels) to be considered in the scanning process. void
setMinCharHeight(Integer minCharHeight)
Sets a minimum character height (in pixels) to be considered in the scanning process. Integer
getMaxCharHeight()
Sets a maximum character height (in pixels) to be considered in the scanning process. void
setMaxCharHeight(Integer maxCharHeight)
Sets a maximum character height (in pixels) to be considered in the scanning process. String
getValidationRegex()
Sets a regular expression which the scanned text needs to match in order to trigger a scan result. void
setValidationRegex(String validationRegex)
Sets a regular expression which the scanned text needs to match in order to trigger a scan result. String
getCharWhitelist()
Restricts the scanner to a set of characters to be detected. void
setCharWhitelist(String charWhitelist)
Restricts the scanner to a set of characters to be detected. String
toString()
int
hashCode()
boolean
equals(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()
-
-
-
-