-
- All Implemented Interfaces:
-
io.scanbot.sdk.camera.FrameHandler
public final class GenericDocumentRecognizerFrameHandler implements FrameHandlerPerforms document recognition on camera preview frames. Outputs results via GenericDocumentRecognizerFrameHandler.ResultHandler.
Preview frame considered intercepted if at least one GenericDocumentRecognizerFrameHandler.ResultHandler returns
truefrom GenericDocumentRecognizerFrameHandler.ResultHandler.handle
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceGenericDocumentRecognizerFrameHandler.ResultHandlerContinuously notified about document recognition results.
public abstract classGenericDocumentRecognizerFrameHandler.GenericDocumentRecognizerResultHandlerSuccessor-class needed for cross-platform implementation
public classGenericDocumentRecognizerFrameHandler.Companion
-
Constructor Summary
Constructors Constructor Description GenericDocumentRecognizerFrameHandler(GenericDocumentRecognizer genericDocumentRecognizer, Boolean shouldRecognize)
-
Method Summary
Modifier and Type Method Description final BooleangetIsEnabled()Parameter determines if document detection is enabled. final UnitsetIsEnabled(Boolean isEnabled)Parameter determines if document detection is enabled. BooleanhandleFrame(FrameHandler.Frame previewFrame)final UnitaddResultHandler(GenericDocumentRecognizerFrameHandler.ResultHandler resultHandler)Registers result handler which will be notified about Generic Document results. final UnitremoveResultHandler(GenericDocumentRecognizerFrameHandler.ResultHandler resultHandler)Unregisters handler. final UnitclearResultHandlers()Unregisters all handlers. -
-
Constructor Detail
-
GenericDocumentRecognizerFrameHandler
GenericDocumentRecognizerFrameHandler(GenericDocumentRecognizer genericDocumentRecognizer, Boolean shouldRecognize)
- Parameters:
shouldRecognize- whether to recognize field and their data on ID card.
-
-
Method Detail
-
getIsEnabled
final Boolean getIsEnabled()
Parameter determines if document detection is enabled. In case of
falsevalue incoming frames are skipped.Default is
true
-
setIsEnabled
final Unit setIsEnabled(Boolean isEnabled)
Parameter determines if document detection is enabled. In case of
falsevalue incoming frames are skipped.Default is
true
-
handleFrame
@Synchronized() Boolean handleFrame(FrameHandler.Frame previewFrame)
-
addResultHandler
final Unit addResultHandler(GenericDocumentRecognizerFrameHandler.ResultHandler resultHandler)
Registers result handler which will be notified about Generic Document results.
Results are coming on the worker thread. Don't forget to move execution to main thread before updating UI.
- Parameters:
resultHandler- handler to register.
-
removeResultHandler
final Unit removeResultHandler(GenericDocumentRecognizerFrameHandler.ResultHandler resultHandler)
Unregisters handler.
- Parameters:
resultHandler- handler to unregister.
-
clearResultHandlers
final Unit clearResultHandlers()
Unregisters all handlers. If nothing was registered before, nothing happens.
-
-
-
-