Class GenericTextRecognizerFrameHandler
-
- All Implemented Interfaces:
public final class GenericTextRecognizerFrameHandler extends FrameHandler
Performs generic text recognition on camera preview frames. Outputs results via GenericTextRecognizerFrameHandler.ResultHandler.
Preview frame considered intercepted if at least one GenericTextRecognizerFrameHandler.ResultHandler returns
true
from GenericTextRecognizerFrameHandler.ResultHandler.handle
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
GenericTextRecognizerFrameHandler.ResultHandler
Continuously notified about generic text recognition results.
public abstract class
GenericTextRecognizerFrameHandler.TextRecognitionScannerResultHandler
Successor-class needed for cross-platform implementation
-
Constructor Summary
Constructors Constructor Description GenericTextRecognizerFrameHandler(GenericTextRecognizer genericTextRecognizer)
-
Method Summary
Modifier and Type Method Description Boolean
handleFrame(FrameHandler.Frame previewFrame)
Invoked for every new camera preview frame. final Unit
addResultHandler(GenericTextRecognizerFrameHandler.ResultHandler resultHandler)
Registers result handler which will be notified about generic text recognition results. final Unit
removeResultHandler(GenericTextRecognizerFrameHandler.ResultHandler resultHandler)
Unregisters handler. final Unit
clearResultHandlers()
Unregisters all handlers. final static GenericTextRecognizerFrameHandler
attach(IScanbotCameraView cameraView, GenericTextRecognizer genericTextRecognizer)
Convenience method for creating new GenericTextRecognizerFrameHandler and adding it as FrameHandler to given camera view. -
-
Constructor Detail
-
GenericTextRecognizerFrameHandler
GenericTextRecognizerFrameHandler(GenericTextRecognizer genericTextRecognizer)
-
-
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(GenericTextRecognizerFrameHandler.ResultHandler resultHandler)
Registers result handler which will be notified about generic text recognition 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(GenericTextRecognizerFrameHandler.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 GenericTextRecognizerFrameHandler attach(IScanbotCameraView cameraView, GenericTextRecognizer genericTextRecognizer)
Convenience method for creating new GenericTextRecognizerFrameHandler and adding it as FrameHandler to given camera view.
- Parameters:
cameraView
- cameraView to attach handler togenericTextRecognizer
- scanner to perform ID card detection
-
-
-
-