Skip to main content

Cheque Recognizer | iOS Document Scanner

The Scanbot SDK provides the ability to recognize U.S. cheques in a UIImage or CMSampleBufferRef. After successful detection, it runs a recognition operation to extract the data fields of the detected cheque. The result is encapsulated in an SBSDKChequeRecognizerResult instance.

Usage of the cheque recognizer#

import UIKitimport ScanbotSDK
class ChequeScannerViewController: UIViewController {
    // Create the instance of the cheque recognizer.    private let recognizer: SBSDKChequeRecognizer = SBSDKChequeRecognizer()
    // Create the instance of the camera session.    private let cameraSession: SBSDKCameraSession = SBSDKCameraSession(for: FeatureCheque)
    override func viewDidLoad() {        super.viewDidLoad()
        // Set the video delegate to this view controller.        self.cameraSession.videoDelegate = self    }}
extension ChequeScannerViewController: SBSDKCameraSessionDelegate {    func captureOutput(_ output: AVCaptureOutput,                       didOutput sampleBuffer: CMSampleBuffer,                       from connection: AVCaptureConnection) {        // Run recognition of CMSampleBufferRef.        if let result = self.recognizer.recognizeCheque(on: sampleBuffer,                                                        orientation: self.cameraSession.videoOrientation) {            DispatchQueue.main.async {                // Process the recognized result.            }        }    }}