SBSDKPayFormScanner

@interface SBSDKPayFormScanner : NSObject

The main scanner class that performs detection and recognition on either UIImage or CMSampleBufferRef (from camera). Usually start with detection on a smaller image (video frame) and if detection was successful (isValidForm == YES) run recognition on either the same or a larger image (camera still shot). The larger the image the better the recognition results. Images are rotated accordingly to either the UIImage imageOrientation property or the given video orientation. Detection and recognition are successful only if the rotated image has natural orientation.

Note: This class needs the german (deu.traineddata) language file installed. See SBSDKOpticalTextRecognizer on how to install language files in your app.

  • Detects whether an image contains a bank transfer form or not on the given UIImage.

    Declaration

    Objective-C

    - (nullable SBSDKPayFormDetectionResult *)detectOnImage:
        (nonnull UIImage *)image;

    Swift

    func detect(on image: UIImage) -> SBSDKPayFormDetectionResult?

    Parameters

    image

    The image to detect a payform on.

    Return Value

    The detectors result.

  • Detects whether an image contains a bank transfer form or not on the given CMSampleBufferRef.

    Declaration

    Objective-C

    - (nullable SBSDKPayFormDetectionResult *)
        detectInSampleBuffer:(nonnull CMSampleBufferRef)sampleBuffer
                 orientation:(AVCaptureVideoOrientation)videoOrientation;

    Swift

    func detect(in sampleBuffer: CMSampleBuffer, orientation videoOrientation: AVCaptureVideoOrientation) -> SBSDKPayFormDetectionResult?

    Parameters

    sampleBuffer

    The CMSampleBuffer to detect a payform on.

    videoOrientation

    The orientation the sample buffer is taken with.

    Return Value

    The detectors result.

  • Recognizes the bank transfer form fields in the given UIImage.

    Declaration

    Objective-C

    - (nullable SBSDKPayFormRecognitionResult *)recognizeFieldsOnImage:
        (nonnull UIImage *)image;

    Swift

    func recognizeFields(on image: UIImage) -> SBSDKPayFormRecognitionResult?

    Parameters

    image

    The image to recognize a payform on.

    Return Value

    The recognizers result.

  • Recognizes the bank transfer form fields in the given CMSampleBufferRef.

    Declaration

    Objective-C

    - (nullable SBSDKPayFormRecognitionResult *)
        recognizeFieldsInSampleBuffer:(nonnull CMSampleBufferRef)sampleBuffer
                          orientation:(AVCaptureVideoOrientation)videoOrientation;

    Swift

    func recognizeFields(in sampleBuffer: CMSampleBuffer, orientation videoOrientation: AVCaptureVideoOrientation) -> SBSDKPayFormRecognitionResult?

    Parameters

    sampleBuffer

    The CMSampleBuffer to recognize a payform on.

    videoOrientation

    The orientation the sample buffer is taken with.

    Return Value

    The recognizers result.