Interface GenericTextRecognizer
-
- All Implemented Interfaces:
public interface GenericTextRecognizerComponent to scan image, recognize text on it and validate the recognized text.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceGenericTextRecognizer.GenericTextValidationCallbackCallback for text validation.
public interfaceGenericTextRecognizer.CleanRecognitionResultCallbackOptional callback to clean recognized string prior to validation. Allows to increase the quality and speed of the recognition.
-
Method Summary
Modifier and Type Method Description abstract GenericTextRecognitionResultscanNv21(ByteArray nv21, Integer width, Integer height, Integer orientation, Rect finderRect)Scan image to recognize text on it abstract UnitsetValidator(String pattern, GenericTextRecognizer.GenericTextValidationCallback callback)Sets the configuration to use during the validation abstract UnitsetCleaner(GenericTextRecognizer.CleanRecognitionResultCallback callback)Sets the cleaner for the raw text to prepare the raw recognized string to validation. abstract UnitcleanRecognitionQueue()Allows to clean the accumulated frames inside the recognizer. abstract IntegergetMinimumNumberOfRequiredFramesWithEqualRecognitionResult()Minimum number of accumulated frames that have equal result. abstract UnitsetMinimumNumberOfRequiredFramesWithEqualRecognitionResult(Integer minimumNumberOfRequiredFramesWithEqualRecognitionResult)Minimum number of accumulated frames that have equal result. abstract IntegergetMaximumNumberOfAccumulatedFrames()Maximum number of accumulated frames to inspect before actual result is returned. abstract UnitsetMaximumNumberOfAccumulatedFrames(Integer maximumNumberOfAccumulatedFrames)Maximum number of accumulated frames to inspect before actual result is returned. abstract IntegergetOcrResolutionLimit()The image will be downscaled to the given value during the processing. abstract UnitsetOcrResolutionLimit(Integer ocrResolutionLimit)The image will be downscaled to the given value during the processing. abstract BooleangetMatchSubstringForPattern()Find and match only part of the whole string if the pattern is used. abstract UnitsetMatchSubstringForPattern(Boolean matchSubstringForPattern)Find and match only part of the whole string if the pattern is used. abstract Set<Character>getAllowedSymbols()Allowed symbols to be detected. abstract UnitsetAllowedSymbols(Set<Character> allowedSymbols)Allowed symbols to be detected. -
-
Method Detail
-
scanNv21
abstract GenericTextRecognitionResult scanNv21(ByteArray nv21, Integer width, Integer height, Integer orientation, Rect finderRect)
Scan image to recognize text on it
- Parameters:
nv21- image in form of nv21-encoded byte arraywidth- image width, pixelsheight- image height, pixelsorientation- image orientation.finderRect- if non-null - perform scanning only in given area.
-
setValidator
abstract Unit setValidator(String pattern, GenericTextRecognizer.GenericTextValidationCallback callback)
Sets the configuration to use during the validation
- Parameters:
pattern- sets a validation pattern (Supports ?callback- callback to validate a string in recognizer
-
setCleaner
abstract Unit setCleaner(GenericTextRecognizer.CleanRecognitionResultCallback callback)
Sets the cleaner for the raw text to prepare the raw recognized string to validation. Allows to increase the quality and speed of the recognition
- Parameters:
callback- callback to clean the raw text extracted from the picture and to extract only valuable part from it
-
cleanRecognitionQueue
abstract Unit cleanRecognitionQueue()
Allows to clean the accumulated frames inside the recognizer. Should be called if reusing the instance after getting the successful result.
-
getMinimumNumberOfRequiredFramesWithEqualRecognitionResult
abstract Integer getMinimumNumberOfRequiredFramesWithEqualRecognitionResult()
Minimum number of accumulated frames that have equal result.
-
setMinimumNumberOfRequiredFramesWithEqualRecognitionResult
abstract Unit setMinimumNumberOfRequiredFramesWithEqualRecognitionResult(Integer minimumNumberOfRequiredFramesWithEqualRecognitionResult)
Minimum number of accumulated frames that have equal result.
-
getMaximumNumberOfAccumulatedFrames
abstract Integer getMaximumNumberOfAccumulatedFrames()
Maximum number of accumulated frames to inspect before actual result is returned.
-
setMaximumNumberOfAccumulatedFrames
abstract Unit setMaximumNumberOfAccumulatedFrames(Integer maximumNumberOfAccumulatedFrames)
Maximum number of accumulated frames to inspect before actual result is returned.
-
getOcrResolutionLimit
abstract Integer getOcrResolutionLimit()
The image will be downscaled to the given value during the processing. If the quality of the scanning is not enough, try to increase the limit. This variable affects the performance of the scanning process. Higher the size limit - better the quality, but the recognition is slower
0 - do not rescale.
-
setOcrResolutionLimit
abstract Unit setOcrResolutionLimit(Integer ocrResolutionLimit)
The image will be downscaled to the given value during the processing. If the quality of the scanning is not enough, try to increase the limit. This variable affects the performance of the scanning process. Higher the size limit - better the quality, but the recognition is slower
0 - do not rescale.
-
getMatchSubstringForPattern
abstract Boolean getMatchSubstringForPattern()
Find and match only part of the whole string if the pattern is used.
-
setMatchSubstringForPattern
abstract Unit setMatchSubstringForPattern(Boolean matchSubstringForPattern)
Find and match only part of the whole string if the pattern is used.
-
getAllowedSymbols
abstract Set<Character> getAllowedSymbols()
Allowed symbols to be detected.
-
setAllowedSymbols
abstract Unit setAllowedSymbols(Set<Character> allowedSymbols)
Allowed symbols to be detected.
-
-
-
-