public final class BlinkOCREngineOptions extends AbstractOCREngineOptions
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator |
CREATOR
Parcelable creator.
|
mNativeContext
Constructor and Description |
---|
BlinkOCREngineOptions()
Default constructor.
|
BlinkOCREngineOptions(long nativeContext,
java.lang.Object keep)
Constructor from native object.
|
Modifier and Type | Method and Description |
---|---|
BlinkOCREngineOptions |
addAllDigitsToWhitelist(OcrFont font)
Adds all digits with given font to whitelist.
|
BlinkOCREngineOptions |
addCharIntervalToWhitelist(char firstValue,
char lastValue,
OcrFont font)
Adds a interval of chars including first and last to whitelist in given font (use OcrFont.ANY to cover all available fonts).
|
BlinkOCREngineOptions |
addCharToWhitelist(BlinkOCRCharKey charKey)
Adds a char+font combination to set of allowed chars.
|
BlinkOCREngineOptions |
addCharToWhitelist(char value,
OcrFont font)
Adds a char+font combination to set of allowed chars.
|
BlinkOCREngineOptions |
addLowercaseCharsToWhitelist(OcrFont font)
Adds all lowercase ascii chars with given font to whitelist.
|
BlinkOCREngineOptions |
addUppercaseCharsToWhitelist(OcrFont font)
Adds all uppercase ascii chars with given font to whitelist.
|
BlinkOCREngineOptions |
allowAllCharsAndAllFonts()
Allows all supported chars in all supported fonts.
|
BlinkOCREngineOptions |
clone()
Creates a copy of
BlinkOCREngineOptions object. |
protected void |
deserializeNative(byte[] bytes) |
OcrDocumentType |
getDocumentType()
Returns the current OCR document type.
|
int |
getMaximumLineHeight()
Returns the maximum height of the line of text given in pixels.
|
int |
getMinimumCharHeight()
Returns the minimum height of char that can be classified.
|
int |
getMinimumLineHeight()
Returns the minimum height of the line of text given in pixels.
|
boolean |
isCasePostprocessorEnabled()
Returns whether case postprocessing is enabled.
|
boolean |
isCutoffCharFilterEnabled()
Returns whether cutoff char filter is enabled.
|
boolean |
isDetectFlippedTextEnabled()
Returns whether flipped text detection is enabled.
|
boolean |
isImageProcessingEnabled()
Returns true if image processing is performed on image.
|
boolean |
isNoisePostprocessingEnabled()
Returns whether noise postprocessing is enabled.
|
boolean |
isRatioPostprocessorEnabled()
Returns whether ratio postprocessor is enabled.
|
boolean |
isWordProcessingEnabled()
Returns whether word processing is enabled.
|
protected byte[] |
serializeNative() |
BlinkOCREngineOptions |
setCasePostprocessorEnabled(boolean casePostprocessorEnabled)
If enabled, classification will be aided by character position in line.
|
BlinkOCREngineOptions |
setCutoffCharFilterEnabled(boolean cutoffCharFilterEnabled)
If enabled, all chars that are classified as cutoff, in other words chars
that exceed image bounds, will be removed from the result.
|
BlinkOCREngineOptions |
setDetectFlippedTextEnabled(boolean detectFlippedTextEnabled)
If enabled, OCR will produce result for the input image and for
input image rotated by 180 degrees.
|
BlinkOCREngineOptions |
setDocumentType(OcrDocumentType documentType)
Specifies the OCR document type that will be used to adjust the ocr engine settings.
|
BlinkOCREngineOptions |
setImageProcessingEnabled(boolean imageProcessingEnabled)
Specifies if the image processing is performed on image
By default it's set to true.
|
BlinkOCREngineOptions |
setMaximumLineHeight(int maximumLineHeight)
Sets the maximum height of the line of text given in pixels.
|
BlinkOCREngineOptions |
setMinimumCharHeight(int minimumCharHeight)
Sets the minimum height of the char that can be classified.
|
BlinkOCREngineOptions |
setMinimumLineHeight(int minimumLineHeight)
Sets the minimum height of the line of text given in pixels.
|
BlinkOCREngineOptions |
setNoisePostprocessingEnabled(boolean noisePostprocessingEnabled)
If enabled noisy lines will be removed from the result.
|
BlinkOCREngineOptions |
setRatioPostprocessorEnabled(boolean ratioPostprocessorEnabled)
If enabled, char quality will be influenced by character ratio difference
from the original character in font specified by classification.
|
BlinkOCREngineOptions |
setWordProcessingEnabled(boolean wordProcessingEnabled)
If the option is enabled, words in the OCR result will be
processed and possibly classified as numbers, lower case
words, upper case, ...
|
protected void |
terminateNative(long nativeContext) |
describeContents, finalize, getMaximumAllowedCharRecognitionVariants, getMaximumCharsExpected, getNativeContext, isColorDropoutEnabled, setColorDropoutEnabled, setMaximumAllowedCharRecognitionVariants, setMaximumCharsExpected, writeToParcel
@NonNull public static final android.os.Parcelable.Creator CREATOR
public BlinkOCREngineOptions()
public BlinkOCREngineOptions(long nativeContext, @Nullable java.lang.Object keep)
nativeContext
- Native engine options object.keep
- Owner of the native engine options object.@NonNull public BlinkOCREngineOptions clone()
BlinkOCREngineOptions
object.clone
in class java.lang.Object
public final int getMinimumLineHeight()
@NonNull public final BlinkOCREngineOptions setMinimumLineHeight(int minimumLineHeight)
minimumLineHeight
- minimum height of the linepublic final int getMaximumLineHeight()
@NonNull public final BlinkOCREngineOptions setMaximumLineHeight(int maximumLineHeight)
maximumLineHeight
- maximum height of the linepublic final int getMinimumCharHeight()
@NonNull public final BlinkOCREngineOptions setMinimumCharHeight(int minimumCharHeight)
BlinkOCREngineOptions.setMinimumLineHeight(int)
, this value refers to individual
chars, while BlinkOCREngineOptions.setMinimumLineHeight(int)
refers to line height, which equals to height
of largest char in line.minimumCharHeight
- minimum height of the char@NonNull public BlinkOCREngineOptions setImageProcessingEnabled(boolean imageProcessingEnabled)
imageProcessingEnabled
- whether or not image processing should be performed on imagepublic boolean isImageProcessingEnabled()
@NonNull public BlinkOCREngineOptions setDocumentType(@NonNull OcrDocumentType documentType)
OcrDocumentType.OCR_DOCUMENT_TYPE_GENERIC
.
Default OCR document type is the best option in most cases and should not be changed unless
the specific type is required.documentType
- Desired OCR document type that will be used to adjust the ocr engine settings.@NonNull public OcrDocumentType getDocumentType()
BlinkOCREngineOptions.setDocumentType(OcrDocumentType)
.@NonNull public BlinkOCREngineOptions addCharToWhitelist(@NonNull BlinkOCRCharKey charKey)
charKey
- char+font combination that should be allowed@NonNull public BlinkOCREngineOptions addCharToWhitelist(char value, @NonNull OcrFont font)
value
- Value of the char. Whitespace characters are ignored.font
- Font in which char will be allowed. Use OcrFont.ANY to cover all available fonts.@NonNull public BlinkOCREngineOptions addCharIntervalToWhitelist(char firstValue, char lastValue, @NonNull OcrFont font)
firstValue
- first char that will be added to whitelistlastValue
- last char that will be added to whitelistfont
- font in which chars will be allowed. Use OcrFont.ANY to cover all available fonts.@NonNull public BlinkOCREngineOptions addAllDigitsToWhitelist(@NonNull OcrFont font)
font
- font in which chars will be allowed. Use OcrFont.ANY to cover all available fonts.@NonNull public BlinkOCREngineOptions addLowercaseCharsToWhitelist(@NonNull OcrFont font)
font
- font in which chars will be allowed. Use OcrFont.ANY to cover all available fonts.@NonNull public BlinkOCREngineOptions addUppercaseCharsToWhitelist(@NonNull OcrFont font)
font
- font in which chars will be allowed. Use OcrFont.ANY to cover all available fonts.@NonNull public BlinkOCREngineOptions allowAllCharsAndAllFonts()
@NonNull public BlinkOCREngineOptions setWordProcessingEnabled(boolean wordProcessingEnabled)
public boolean isWordProcessingEnabled()
BlinkOCREngineOptions.setWordProcessingEnabled(boolean)
BlinkOCREngineOptions.setWordProcessingEnabled(boolean)
@NonNull public BlinkOCREngineOptions setDetectFlippedTextEnabled(boolean detectFlippedTextEnabled)
public boolean isDetectFlippedTextEnabled()
BlinkOCREngineOptions.setDetectFlippedTextEnabled(boolean)
.BlinkOCREngineOptions.setDetectFlippedTextEnabled(boolean)
.@NonNull public BlinkOCREngineOptions setCasePostprocessorEnabled(boolean casePostprocessorEnabled)
public boolean isCasePostprocessorEnabled()
BlinkOCREngineOptions.setCasePostprocessorEnabled(boolean)
.BlinkOCREngineOptions.setCasePostprocessorEnabled(boolean)
.@NonNull public BlinkOCREngineOptions setNoisePostprocessingEnabled(boolean noisePostprocessingEnabled)
public boolean isNoisePostprocessingEnabled()
BlinkOCREngineOptions.setNoisePostprocessingEnabled(boolean)
.BlinkOCREngineOptions.setNoisePostprocessingEnabled(boolean)
.@NonNull public BlinkOCREngineOptions setRatioPostprocessorEnabled(boolean ratioPostprocessorEnabled)
public boolean isRatioPostprocessorEnabled()
BlinkOCREngineOptions.setRatioPostprocessorEnabled(boolean)
.BlinkOCREngineOptions.setRatioPostprocessorEnabled(boolean)
.@NonNull public BlinkOCREngineOptions setCutoffCharFilterEnabled(boolean cutoffCharFilterEnabled)
public boolean isCutoffCharFilterEnabled()
BlinkOCREngineOptions.setCutoffCharFilterEnabled(boolean)
.BlinkOCREngineOptions.setCutoffCharFilterEnabled(boolean)
.protected void terminateNative(long nativeContext)
terminateNative
in class AbstractOCREngineOptions
@NonNull protected byte[] serializeNative()
serializeNative
in class AbstractOCREngineOptions
protected void deserializeNative(@NonNull byte[] bytes)
deserializeNative
in class AbstractOCREngineOptions