SBSDKGenericTextLineRecognizer
@interface SBSDKGenericTextLineRecognizer : NSObject
A class to recognize one line of text in a small area and run validation on the result. It is intended to be a very generic text-based live video recognizer for tasks that can’t be accomplished with the specialized recognizers in ScanbotSDK.
-
Unavailable.
Declaration
Objective-C
- (nonnull instancetype)init;
-
Initializes an instance with the given configuration. Returns nil, if the required OCR resources are not installed.
Declaration
Objective-C
- (nullable instancetype)initWithConfiguration: (nonnull SBSDKGenericTextLineRecognizerConfiguration *)configuration;
Swift
init?(configuration: SBSDKGenericTextLineRecognizerConfiguration)
Parameters
configuration
The configuration object to be used to configure the new instance.
-
Recognizes text information from given sample buffer. Intended for usage with live detection.
Declaration
Objective-C
- (nullable SBSDKGenericTextLineRecognizerResult *) recognizeFromSampleBuffer:(nonnull CMSampleBufferRef)sampleBufferRef orientation:(AVCaptureVideoOrientation)videoOrientation inRect:(CGRect)rect;
Swift
func recognize(from sampleBufferRef: CMSampleBuffer, orientation videoOrientation: AVCaptureVideoOrientation, in rect: CGRect) -> SBSDKGenericTextLineRecognizerResult?
Parameters
sampleBufferRef
The sample buffer reference.
videoOrientation
Video frame orientation. Should be the orientation that the device currently has, not actual image orientation.
rect
Rectangle in image coordinates in which to perform the search. Must be inside the image.
Return Value
The result of the recognition.
-
Clears the frame accumulator of the recognizer. This should be called after retrieving a result and initiating a new recognition.
Declaration
Objective-C
- (void)clearFrameAccumulator;
Swift
func clearFrameAccumulator()