public class RecognitionSettings extends Object
| Constructor and Description |
|---|
RecognitionSettings()
Default constructor: set recognitionAreas null, detectAreas true, autoSkew true, recognizeSingleLine false.
|
RecognitionSettings(ArrayList<Rectangle> recognitionAreas)
Constructor allows to set recognitionAreas.
|
RecognitionSettings(ArrayList<Rectangle> recognitionAreas,
boolean detectAreas,
boolean autoSkew,
boolean recognizeSingleLine)
Constructor allows to set all options.
|
RecognitionSettings(boolean recognizeSingleLine)
Constructor allows to set recognizeSingleLine.
|
RecognitionSettings(boolean detectAreas,
boolean autoSkew)
Constructor allows to set detectAreas and autoSkew.
|
RecognitionSettings(DocumentRecognitionSettings docSettings) |
| Modifier and Type | Method and Description |
|---|---|
void |
setAllowedCharacters(CharactersAllowedType allowedCharacters)
Allowed characters set.
|
void |
setAutoContrast(boolean autoContrast)
Allows using an additional contrast correction algorithm for the image before recognition.
|
void |
setAutoSkew(boolean autoSkew)
Sets a flag indicating whether automatic image skew correction should be enabled.
|
void |
setDetectAreas(boolean detectAreas)
Sets a flag indicating whether automatic text areas detection should be enabled.
|
void |
setIgnoredCharacters(String characters)
Sets blacklist for recognition symbols.
|
void |
setLanguage(Language language) |
void |
setLinesFiltration(boolean linesFiltration)
Allows to recognize text in the tables (regions surrounded lines).
|
void |
setPreprocessingFilters(PreprocessingFilter preprocessingFilters)
Allows to prepare the image for OCR by adjusting pre-processing methods.
|
void |
setRecognitionAreas(ArrayList<Rectangle> recognitionAreas)
Sets the list of text areas for processing.
|
void |
setRecognizeSingleLine(boolean recognizeSingleLine)
Sets single-line image recognition.
|
void |
setSkew(double skew)
Sets angle in degrees for image rotation.
|
void |
setThreadsCount(int threadsCount)
Gets or sets the number of threads for processing.
|
void |
setThresholdValue(int threshold)
Sets custom threshold value for image binarization.
|
public RecognitionSettings()
public RecognitionSettings(ArrayList<Rectangle> recognitionAreas, boolean detectAreas, boolean autoSkew, boolean recognizeSingleLine)
recognitionAreas - Rectangles for recognition.detectAreas - False for recognition as one area, true for dividing into areas before recognition.autoSkew - True if the image needs alignment.recognizeSingleLine - True if the image contains only one line.public RecognitionSettings(ArrayList<Rectangle> recognitionAreas)
recognitionAreas - Rectangles for recognition.public RecognitionSettings(boolean detectAreas,
boolean autoSkew)
detectAreas - False for recognition as one area, true for dividing into areas before recognition.autoSkew - True if the image needs alignment.public RecognitionSettings(boolean recognizeSingleLine)
recognizeSingleLine - True if the image contains only one line.public RecognitionSettings(DocumentRecognitionSettings docSettings)
public void setRecognitionAreas(ArrayList<Rectangle> recognitionAreas)
setDetectAreas(boolean) and setAutoSkew(boolean) properties will be ignored.
Disables DetectAreas and AutoSkew.recognitionAreas - Rectangles for recognition.public void setDetectAreas(boolean detectAreas)
detectAreas - Detect and split if true.public void setLinesFiltration(boolean linesFiltration)
linesFiltration - false - allows increase performance and don't detect tables and remove lines; otherwise - true.
Disabled (false) by default.public void setAutoSkew(boolean autoSkew)
autoSkew - Detect and rotate if true.public void setRecognizeSingleLine(boolean recognizeSingleLine)
setRecognitionAreas(ArrayList) settings, so all areas settings will be ignored.recognizeSingleLine - True for single-line imagepublic void setSkew(double skew)
setAutoSkew(boolean) property, so that auto skew correction is not applied.skew - Rotate image on specified angle.public void setLanguage(Language language)
language - Sets the language used for OCR.
Multi-language (none) by default.public void setIgnoredCharacters(String characters)
characters - Characters excluded from recognition.public void setThresholdValue(int threshold)
threshold - Range from 1 to 255.public void setThreadsCount(int threadsCount)
threadsCount - the number of threads that will be created for parallel recognition of image fragments.public void setPreprocessingFilters(PreprocessingFilter preprocessingFilters)
preprocessingFilters - contains user preprocessing operations or null.public void setAutoContrast(boolean autoContrast)
autoContrast - contains boolean value - a contrast correction filter is set.public void setAllowedCharacters(CharactersAllowedType allowedCharacters)
allowedCharacters - contains enum @see CharactersAllowedType value.Copyright © 2021 Aspose. All rights reserved.