RecognitionSettings

Inheritance: java.lang.Object

public class RecognitionSettings

Settings for the image recognition. Contains elements that allow customizing the recognition process.

Constructors

ConstructorDescription
RecognitionSettings()Default constructor: set recognitionAreas null, linesFiltration false, autoSkew false, recognizeSingleLine false.
RecognitionSettings(ArrayList recognitionAreas, boolean recognizeSingleLine)Constructor allows to set all options.
RecognitionSettings(boolean recognizeSingleLine)Constructor allows to set recognizeSingleLine.
RecognitionSettings(ReceiptRecognitionSettings recSettings)
RecognitionSettings(InvoiceRecognitionSettings recSettings)
RecognitionSettings(IDCardRecognitionSettings recSettings)
RecognitionSettings(PassportRecognitionSettings recSettings)
RecognitionSettings(CarPlateRecognitionSettings recSettings)

Methods

MethodDescription
equals(Object arg0)
getClass()
hashCode()
notify()
notifyAll()
setAllowedCharacters(CharactersAllowedType allowedCharacters)Allowed characters set.
setAllowedCharacters(String allowedCharacters)Allowed characters set.
setAutomaticColorInversion(boolean automaticColorInversion)Detect images with white text on dark/black background and automatically choose a special OCR algorithm for them.
setDetectAreasMode(DetectAreasMode detectAreasMode)Determines the type of neural network used for areas detection.
setIgnoredCharacters(String characters)Sets blacklist for recognition symbols.
setLanguage(Language language)
setLinesFiltration(boolean linesFiltration)Allows to recognize text in the tables (regions surrounded lines).
setRecognitionAreas(ArrayList recognitionAreas)Sets the list of text areas for processing.
setRecognizeSingleLine(boolean recognizeSingleLine)Sets single-line image recognition.
setThreadsCount(int threadsCount)Gets or sets the number of threads for processing.
setUpscaleSmallFont(boolean upscaleSmallFont)Allows you to use additional algorithms specifically for small font recognition.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

RecognitionSettings()

public RecognitionSettings()

Default constructor: set recognitionAreas null, linesFiltration false, autoSkew false, recognizeSingleLine false.

RecognitionSettings(ArrayList recognitionAreas, boolean recognizeSingleLine)

public RecognitionSettings(ArrayList<Rectangle> recognitionAreas, boolean recognizeSingleLine)

Constructor allows to set all options.

Parameters:

ParameterTypeDescription
recognitionAreasjava.util.ArrayList<java.awt.Rectangle>Rectangles for recognition.
recognizeSingleLinebooleanTrue if the image contains only one line.

RecognitionSettings(boolean recognizeSingleLine)

public RecognitionSettings(boolean recognizeSingleLine)

Constructor allows to set recognizeSingleLine. Default values in this case: detectAreas - false, autoSkew = false, recognitionAreas - null.

Parameters:

ParameterTypeDescription
recognizeSingleLinebooleanTrue if the image contains only one line.

RecognitionSettings(ReceiptRecognitionSettings recSettings)

public RecognitionSettings(ReceiptRecognitionSettings recSettings)

Parameters:

ParameterTypeDescription
recSettingsReceiptRecognitionSettings

RecognitionSettings(InvoiceRecognitionSettings recSettings)

public RecognitionSettings(InvoiceRecognitionSettings recSettings)

Parameters:

ParameterTypeDescription
recSettingsInvoiceRecognitionSettings

RecognitionSettings(IDCardRecognitionSettings recSettings)

public RecognitionSettings(IDCardRecognitionSettings recSettings)

Parameters:

ParameterTypeDescription
recSettingsIDCardRecognitionSettings

RecognitionSettings(PassportRecognitionSettings recSettings)

public RecognitionSettings(PassportRecognitionSettings recSettings)

Parameters:

ParameterTypeDescription
recSettingsPassportRecognitionSettings

RecognitionSettings(CarPlateRecognitionSettings recSettings)

public RecognitionSettings(CarPlateRecognitionSettings recSettings)

Parameters:

ParameterTypeDescription
recSettingsCarPlateRecognitionSettings

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

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 string of characters.

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. True by default.

setDetectAreasMode(DetectAreasMode detectAreasMode)

public void setDetectAreasMode(DetectAreasMode detectAreasMode)

Determines the type of neural network used for areas detection.

Parameters:

ParameterTypeDescription
detectAreasModeDetectAreasModecontains enum @see DetectAreasMode value.

setIgnoredCharacters(String characters)

public void setIgnoredCharacters(String characters)

Sets blacklist for recognition symbols.

Parameters:

ParameterTypeDescription
charactersjava.lang.StringCharacters excluded from recognition.

setLanguage(Language language)

public void setLanguage(Language language)

Parameters:

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

setLinesFiltration(boolean linesFiltration)

public void setLinesFiltration(boolean linesFiltration)

Allows to recognize text in the tables (regions surrounded lines).

Parameters:

ParameterTypeDescription
linesFiltrationbooleanfalse - allows increase performance and don’t detect tables and remove lines; otherwise - true. Disabled (false) by default.

setRecognitionAreas(ArrayList recognitionAreas)

public void setRecognitionAreas(ArrayList<Rectangle> recognitionAreas)

Sets the list of text areas for processing. Allows to manually specify the areas with text for more accurate recognition. If custom areas are set setDetectAreasMode(DetectAreasMode) (DetectAreasMode)} not NONE or PreprocessingFilter.AutoSkew() (boolean)} properties will be ignored. Disables DetectAreas and AutoSkew.

Parameters:

ParameterTypeDescription
recognitionAreasjava.util.ArrayList<java.awt.Rectangle>Rectangles for recognition.

setRecognizeSingleLine(boolean recognizeSingleLine)

public void setRecognizeSingleLine(boolean recognizeSingleLine)

Sets single-line image recognition. Disabled (false) by default. Disable all the processing steps associated with splitting into lines. Set this parameter to true if your image contains only one line. Disables setRecognitionAreas(ArrayList) settings, so all areas settings will be ignored.

Parameters:

ParameterTypeDescription
recognizeSingleLinebooleanTrue for single-line image

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.

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 - an upscaleSmallFont is set.

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int