public final class DetectorRecognizer extends TemplatingRecognizer
QuadWithSizeDetector
.
This recognizer is used for implementing support for data extraction from custom document types
by using templating API. If you don't need data extraction, but only want to take cropped
document images, use DocumentCaptureRecognizer instead.Modifier and Type | Class and Description |
---|---|
static class |
DetectorRecognizer.Result |
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator |
CREATOR |
CLASS_NAME
Constructor and Description |
---|
DetectorRecognizer(QuadWithSizeDetector detector) |
Modifier and Type | Method and Description |
---|---|
DetectorRecognizer |
clone()
Create a copy of the entity.
|
void |
consumeResultFrom(Entity other)
Consume result from other entity.
|
protected void |
deserializeNativeSettings(byte[] serializedSettings) |
QuadWithSizeDetector |
getDetector()
Returns the detector that will be used for performing the document detection during recognition
|
boolean |
isAllowFlippedRecognition()
Returns whether or not flipped recognition feature is enabled.
|
protected byte[] |
serializeNativeSettings() |
void |
setAllowFlippedRecognition(boolean allowFlippedRecognition)
Set this to true to enable recognition of document also in upside down direction.
|
void |
setDetectGlare(boolean detectGlare)
Defines whether glare detector will be used during recognition process.
|
protected void |
setNativeTemplatingClasses(long[] nativeTemplatingClasses) |
boolean |
shouldDetectGlare()
Returns whether glare detector is enabled.
|
protected void |
terminateNative(long nativeContext) |
void |
writeToParcel(android.os.Parcel dest,
int flags) |
readFromParcel, setTemplatingClasses
getName, isExcludedFromPing, requiresAutofocus, requiresLandscapeMode
describeContents, finalize, getNativeContext, getResult, nativeGetNativeResultContext
public DetectorRecognizer(@NonNull QuadWithSizeDetector detector)
detector
- Detector that will be used for performing document detection during recognition@NonNull public QuadWithSizeDetector getDetector()
public void setAllowFlippedRecognition(boolean allowFlippedRecognition)
DocumentDetector
).
Keep in mind that enabling this feature will make recognition two times slower
and possibly less accurate. By default, this is turned off.allowFlippedRecognition
- whether or not flipped recognition is allowedpublic boolean isAllowFlippedRecognition()
DetectorRecognizer.setAllowFlippedRecognition(boolean)
.public void setDetectGlare(boolean detectGlare)
GlareDetectorOptions
true
and glare detector is used. If the glare detector is used and
GlareCallback
is set to MetadataCallbacks
,
it will receive glare status will. Also when glare is detected OCR will not be performed on
the affected document position to prevent errors in the extracted data.
By default, this is set to 'true'.detectGlare
- whether glare detector will be used during recognition process.public boolean shouldDetectGlare()
GlareDetectorOptions
true
, otherwise returns false
.protected void setNativeTemplatingClasses(@Nullable long[] nativeTemplatingClasses)
setNativeTemplatingClasses
in class TemplatingRecognizer
protected void terminateNative(long nativeContext)
terminateNative
in class Entity
@Nullable protected byte[] serializeNativeSettings()
serializeNativeSettings
in class Entity
protected void deserializeNativeSettings(@NonNull byte[] serializedSettings)
deserializeNativeSettings
in class Entity
@NonNull public DetectorRecognizer clone()
Entity
RecognizerRunnerView
or RecognizerRunner
with the updated entity hierarchy.clone
in class Recognizer
public void consumeResultFrom(@NonNull Entity other)
Entity
com.microblink.blinkinput.entities.recognizers.RecognizerBundle#loadFromIntent(Intent)
and similar methods to replace the result content of the saved entities with results that
have arrived over Intent
consumeResultFrom
in class TemplatingRecognizer
other
- Entity from which result should be consumed.public void writeToParcel(@NonNull android.os.Parcel dest, int flags)
writeToParcel
in interface android.os.Parcelable
writeToParcel
in class TemplatingRecognizer