public class DefaultGenericTextRecognizer implements GenericTextRecognizer
Default implementation for interface GenericTextRecognizer
interface GenericTextRecognizerpublic DefaultGenericTextRecognizer(@NotNull
io.scanbot.sdk.blob.BlobManager blobManager)
Default implementation for interface GenericTextRecognizer
interface GenericTextRecognizerpublic int getMinimumNumberOfRequiredFramesWithEqualRecognitionResult()
Minimum number of accumulated frames that have equal result
public void setMinimumNumberOfRequiredFramesWithEqualRecognitionResult(int value)
Minimum number of accumulated frames that have equal result
public int getMaximumNumberOfAccumulatedFrames()
Maximum number of accumulated frames to inspect before actual result is returned
public void setMaximumNumberOfAccumulatedFrames(int value)
Maximum number of accumulated frames to inspect before actual result is returned
public int 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.
public void setOcrResolutionLimit(int value)
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.
@NotNull public java.util.Set<io.scanbot.sdk.entity.Language> getSupportedLanguages()
Languages on which the recognition will be run
public void setSupportedLanguages(@NotNull
java.util.Set<? extends io.scanbot.sdk.entity.Language> value)
Languages on which the recognition will be run
@NotNull public java.util.Set<java.lang.Character> getAllowedSymbols()
Allowed symbols to be detected
public void setAllowedSymbols(@NotNull
java.util.Set<java.lang.Character> value)
Allowed symbols to be detected
public boolean getMatchSubstringForPattern()
Find and match only part of the whole string if the pattern is used
public void setMatchSubstringForPattern(boolean value)
Find and match only part of the whole string if the pattern is used
@NotNull public TextFilterStrategy getTextFilterStrategy()
Additional parameter to set the type of the scanned object. TextFilterStrategy.Document by default
public void setTextFilterStrategy(@NotNull
TextFilterStrategy value)
Additional parameter to set the type of the scanned object. TextFilterStrategy.Document by default
@Nullable public GenericTextRecognitionResult scanNv21(@NotNull kotlin.Array[] nv21, int width, int height, int orientation, @Nullable android.graphics.Rect finderRect)
Scan image to recognize text on it
nv21 - image in form of nv21-encoded byte arraywidth - image width, pixelsheight - image height, pixelsorientation - image orientation. Default is 0finderRect - if non-null - perform scanning only in given area. Default is nullpublic void setValidator(@Nullable
java.lang.String validator,
@Nullable
io.scanbot.sdk.generictext.GenericTextRecognizer.GenericTextValidationCallback callback)
Sets the configuration to use during the validation
validator - sets a validation pattern (Supports ? - any character, # - any digit,all other characters represent themselves). Empty string or null will disable the validation)callback - callback to validate a string in recognizerpublic void setCleaner(@Nullable
io.scanbot.sdk.generictext.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
callback - callback to clean the raw text extracted from the picture and to extract only valuable part from itpublic void cleanRecognitionQueue()
Allows to clean the accumulated frames inside the recognizer. Should be called if reusing the instance after getting the successful result