SBSDKChequeRecognizer

@interface SBSDKChequeRecognizer : NSObject

A realtime detector and recognizer for U.S. Cheques. It detects cheques on CMSampleBufferRef object from an AVFoundation video stream. After successful detection it runs a recognition operation to extract the data fields of the detected credit card.

  • Detects and recognizes a cheque 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 recognizeChequeOnImage:orientation: function, if that is an issue.

    Declaration

    Objective-C

    - (nullable SBSDKChequeRecognizerResult *)
        recognizeChequeOnBuffer:(nonnull CMSampleBufferRef)sampleBufferRef
                    orientation:(AVCaptureVideoOrientation)videoOrientation;

    Swift

    func recognizeCheque(on sampleBufferRef: CMSampleBuffer, orientation videoOrientation: AVCaptureVideoOrientation) -> SBSDKChequeRecognizerResult?

    Parameters

    sampleBufferRef

    The video frame or still image as CMSampleBufferRef object to detect a cheque on.

    videoOrientation

    The orientation of the video frame. Should be the orientation that the device currently has, not actual image orientation.

    Return Value

    A SBSDKChequeRecognizerResult object containing the field data or nil if detection or recognition failed.

  • Detects and recognizes a cheque 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 SBSDKChequeRecognizerResult *)
        recognizeChequeOnImage:(nonnull UIImage *)image
                   orientation:(AVCaptureVideoOrientation)videoOrientation;

    Swift

    func recognizeCheque(on image: UIImage, orientation videoOrientation: AVCaptureVideoOrientation) -> SBSDKChequeRecognizerResult?

    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 SBSDKChequeRecognizerResult object containing the field data or nil if detection or recognition failed.

  • Recognizes a cheque in the given image. This function is intended to use for detection on static images.

    Declaration

    Objective-C

    - (nullable SBSDKChequeRecognizerResult *)recognizeChequeOnImage:
        (nonnull UIImage *)image;

    Swift

    func recognizeCheque(on image: UIImage) -> SBSDKChequeRecognizerResult?

    Parameters

    image

    Input image.

    Return Value

    A SBSDKChequeRecognizerResult object containing the field data or nil if detection or recognition failed.

  • Recognizes a cheque in the given image. This function is intended to use for detection on static images.

    Declaration

    Objective-C

    - (nullable SBSDKChequeRecognizerResult *)
        recognizeChequeOnImage:(nonnull UIImage *)image
            autoDetectDocument:(BOOL)autoDetectDocument;

    Swift

    func recognizeCheque(on image: UIImage, autoDetectDocument: Bool) -> SBSDKChequeRecognizerResult?

    Parameters

    image

    Input image.

    autoDetectDocument

    boolean value indicating whether the cheque document should be detected first.

    Return Value

    A SBSDKChequeRecognizerResult object containing the field data or nil if detection or recognition failed.