ReceiptRecognitionSettings

Inheritance: java.lang.Object

public class ReceiptRecognitionSettings

Settings for the receipt recognition Contains elements that allow customizing the recognition process

Constructors

ConstructorDescription
ReceiptRecognitionSettings()Default constructor: set autoSkew true.

Methods

MethodDescription
setLanguage(Language language)
setIgnoredCharacters(String characters)Sets blacklist for recognition symbols.
setThreadsCount(int threadsCount)Gets or sets the number of threads for processing.
setAllowedCharacters(CharactersAllowedType allowedCharacters)Allowed characters set.
setAllowedCharacters(String allowedCharacters)Allowed characters set.
setUpscaleSmallFont(boolean upscaleSmallFont)Allows you to use additional algorithms specifically for small font recognition.
setAutomaticColorInversion(boolean automaticColorInversion)Detect images with white text on dark/black background and automatically choose a special OCR algorithm for them.

ReceiptRecognitionSettings()

public ReceiptRecognitionSettings()

Default constructor: set autoSkew true.

setLanguage(Language language)

public void setLanguage(Language language)

Parameters:

ParameterTypeDescription
languageLanguageSets the language used for OCR. Multi-language (none) by default.

setIgnoredCharacters(String characters)

public void setIgnoredCharacters(String characters)

Sets blacklist for recognition symbols.

Parameters:

ParameterTypeDescription
charactersjava.lang.StringCharacters excluded from recognition.

setThreadsCount(int threadsCount)

public void setThreadsCount(int threadsCount)

Gets or sets the number of threads for processing. By default, 0 means that the image will be processed with the number of threads equal to your number of processors. ThreadsCount = 1 means that the image will be processed in the main thread.

Parameters:

ParameterTypeDescription
threadsCountintthe number of threads that will be created for parallel recognition of image fragments.

setAllowedCharacters(CharactersAllowedType allowedCharacters)

public void setAllowedCharacters(CharactersAllowedType allowedCharacters)

Allowed characters set. Determines the type of characters allowed for recognition result.

Parameters:

ParameterTypeDescription
allowedCharactersCharactersAllowedTypecontains enum @see CharactersAllowedType value.

setAllowedCharacters(String allowedCharacters)

public void setAllowedCharacters(String allowedCharacters)

Allowed characters set. Determines the array of characters allowed for recognition result.

Parameters:

ParameterTypeDescription
allowedCharactersjava.lang.Stringcontains array of characters.

setUpscaleSmallFont(boolean upscaleSmallFont)

public void setUpscaleSmallFont(boolean upscaleSmallFont)

Allows you to use additional algorithms specifically for small font recognition. Useful for images with small size characters.

Parameters:

ParameterTypeDescription
upscaleSmallFontbooleancontains boolean value - a upscaleSmallFont is set.

setAutomaticColorInversion(boolean automaticColorInversion)

public void setAutomaticColorInversion(boolean automaticColorInversion)

Detect images with white text on dark/black background and automatically choose a special OCR algorithm for them.

Parameters:

ParameterTypeDescription
automaticColorInversionbooleancontains boolean value - a automaticColorInversion is set.