SBSDKCheckRecognizer
@interface SBSDKCheckRecognizer : NSObject
A realtime detector and recognizer for U.S. Checks. It detects checks on CMSampleBufferRef object from an AVFoundation video stream. After successful detection it runs a recognition operation to extract the data fields of the detected check.
-
An array of accepted check types. By default all check types are allowed.
Declaration
Objective-C
@property (nonatomic, copy, nonnull) NSArray<SBSDKCheckDocumentRootType *> *acceptedCheckTypes;
Swift
var acceptedCheckTypes: [SBSDKCheckDocumentRootType] { get set }
-
Detects and recognizes a check in the given image. This function is intended to be used with live detection. Video stream from device returns a rotated image, so for example for portrait device orientation, every frame returned will be in landscape left orientation. This function handles these orientation differences, so you shouldn’t fix or rotate the input image. Keep in mind, that the buffer received from the video stream is handled by the system. So in some cases it might be cleaned or changed by the system before recognition occurs. You may convert the buffer to UIImage upon receiving it and use
recognizeOnImage:orientation:
function, if that is an issue.Declaration
Objective-C
- (nullable SBSDKCheckRecognizerResult *) recognizeOnBuffer:(nonnull CMSampleBufferRef)sampleBufferRef orientation:(AVCaptureVideoOrientation)videoOrientation;
Swift
func recognize(on sampleBufferRef: CMSampleBuffer, orientation videoOrientation: AVCaptureVideoOrientation) -> SBSDKCheckRecognizerResult?
Parameters
sampleBufferRef
The video frame or still image as CMSampleBufferRef object to detect a check on.
videoOrientation
The orientation of the video frame. Should be the orientation that the device currently has, not actual image orientation.
Return Value
A SBSDKCheckRecognizerResult object containing the field data or nil if detection or recognition failed.
-
Detects and recognizes a check in the given image. This function is intended to be used with live detection. Video stream from device returns a rotated image, so for example for portrait device orientation, every frame returned will be in landscape left orientation. This function handles these orientation differences, so you shouldn’t fix or rotate the input image.
Declaration
Objective-C
- (nullable SBSDKCheckRecognizerResult *) recognizeOnImage:(nonnull UIImage *)image orientation:(AVCaptureVideoOrientation)videoOrientation;
Swift
func recognize(on image: UIImage, orientation videoOrientation: AVCaptureVideoOrientation) -> SBSDKCheckRecognizerResult?
Parameters
image
Input image.
videoOrientation
The orientation of the video frame. Should be the orientation that the device currently has, not actual image orientation.
Return Value
A SBSDKCheckRecognizerResult object containing the field data or nil if detection or recognition failed.
-
Recognizes a check in the given image. This function is intended to use for detection on static images.
Declaration
Objective-C
- (nullable SBSDKCheckRecognizerResult *)recognizeOnImage: (nonnull UIImage *)image;
Swift
func recognize(on image: UIImage) -> SBSDKCheckRecognizerResult?
Parameters
image
Input image.
Return Value
A SBSDKCheckRecognizerResult object containing the field data or nil if detection or recognition failed.