Class GenericDocumentRecognizerFrameHandler
-
- All Implemented Interfaces:
public final class GenericDocumentRecognizerFrameHandler extends FrameHandler
Performs 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
-
Constructor Summary
Constructors Constructor Description GenericDocumentRecognizerFrameHandler(GenericDocumentRecognizer genericDocumentRecognizer, Boolean shouldRecognize)
-
Method Summary
Modifier and Type Method Description BooleanhandleFrame(FrameHandler.Frame previewFrame)Invoked for every new camera preview frame. 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. final static GenericDocumentRecognizerFrameHandlerattach(IScanbotCameraView cameraView, GenericDocumentRecognizer genericDocumentRecognizer, Boolean shouldRecognize)Convenience method for creating new GenericDocumentRecognizerFrameHandler and adding it as FrameHandler to given camera view. -
-
Constructor Detail
-
GenericDocumentRecognizerFrameHandler
GenericDocumentRecognizerFrameHandler(GenericDocumentRecognizer genericDocumentRecognizer, Boolean shouldRecognize)
- Parameters:
shouldRecognize- whether to recognize field and their data on ID card.
-
-
Method Detail
-
handleFrame
@Synchronized() Boolean handleFrame(FrameHandler.Frame previewFrame)
Invoked for every new camera preview frame.
- Parameters:
previewFrame- captured preview frame data
-
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.
-
attach
final static GenericDocumentRecognizerFrameHandler attach(IScanbotCameraView cameraView, GenericDocumentRecognizer genericDocumentRecognizer, Boolean shouldRecognize)
Convenience method for creating new GenericDocumentRecognizerFrameHandler and adding it as FrameHandler to given camera view.
- Parameters:
cameraView- cameraView to attach handler togenericDocumentRecognizer- recognizer instance to perform document detectionshouldRecognize- whether to recognize fields on documents.
-
-
-
-