Class OcrConfig

  • All Implemented Interfaces:

    
    public class OcrConfig
    
                        

    Configuration for general OCR scanning use-cases

    • Constructor Detail

      • OcrConfig

        OcrConfig()
    • 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.

      • 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.

      • 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.

      • setCharWhitelist

         void setCharWhitelist(String charWhitelist)

        Restricts the scanner to a set of characters to be detected.