public class GenericTextRecognizerFrameHandler
Performs generic text recognition on camera preview frames. Outputs results via
interface GenericTextRecognizerFrameHandler.ResultHandler.
Preview frame considered intercepted if at least one
interface GenericTextRecognizerFrameHandler.ResultHandler returns true from
GenericTextRecognizerFrameHandler.ResultHandler.handle
public static io.scanbot.sdk.generictext.GenericTextRecognizerFrameHandler.Companion Companion
public GenericTextRecognizerFrameHandler(@NotNull
GenericTextRecognizer genericTextRecognizer)
Performs generic text recognition on camera preview frames. Outputs results via
interface GenericTextRecognizerFrameHandler.ResultHandler.
Preview frame considered intercepted if at least one
interface GenericTextRecognizerFrameHandler.ResultHandler returns true from
GenericTextRecognizerFrameHandler.ResultHandler.handle
public boolean isEnabled()
Parameter determines if text recognition is enabled. In case of false value incoming
frames are skipped.
Default is true
public void setEnabled(boolean p)
Parameter determines if text recognition is enabled. In case of false value incoming
frames are skipped.
Default is true
@Synchronized
public boolean handleFrame(@NotNull
io.scanbot.sdk.camera.FrameHandler.Frame previewFrame)
public void addResultHandler(@NotNull
io.scanbot.sdk.generictext.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.
resultHandler - handler to register. Must not be null. If handler was alreadyregistered, nothing happens.public void removeResultHandler(@NotNull
io.scanbot.sdk.generictext.GenericTextRecognizerFrameHandler.ResultHandler resultHandler)
Unregisters handler.
resultHandler - handler to unregister. If it was not registered before, nothing happens.public void clearResultHandlers()
Unregisters all handlers. If nothing was registered before, nothing happens.
public void <no name provided>()
Continuously notified about generic text recognition results.
@JvmStatic @NotNull public static GenericTextRecognizerFrameHandler attach(@NotNull io.scanbot.sdk.ui.camera.IScanbotCameraView cameraView, @NotNull GenericTextRecognizer genericTextRecognizer)
Convenience method for creating new class GenericTextRecognizerFrameHandler and adding it
as FrameHandler to given camera view.
cameraView - cameraView to attach handler togenericTextRecognizer - scanner to perform ID card detectionclass GenericTextRecognizerFrameHandler