SBSDKIDCardRecognizer

@interface SBSDKIDCardRecognizer : NSObject

A recognizer for personal ID cards. Detects and recognizes ID cards on images or video frames and extracts the data fields, like names, dates, photos, signatures and machine readable zones.

Detection is a quick way to check, if there is an ID card present on an image or video frame. Recognition is slower but additionally extracts the data fields from the ID card.

Note: Currently limited to german ID cards.

  • The accepted minimal sharpness score. Images with a score less than that will be rejected with blurry status.

    0 - any image will be accepted. 80 - a good compromise; the recommended setting. 100 - only very sharp images will be accepted.

    The default value is 80.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat sharpnessAcceptanceFactor;

    Swift

    var sharpnessAcceptanceFactor: CGFloat { get set }
  • Detects an ID card on a video frame. Does not recognize and extract field data.

    Declaration

    Objective-C

    - (nullable SBSDKIDCardRecognizerResult *)
        detectIDCardOnBuffer:(nonnull CMSampleBufferRef)sampleBufferRef
                 orientation:(AVCaptureVideoOrientation)videoOrientation;

    Swift

    func detectIDCard(on sampleBufferRef: CMSampleBuffer, orientation videoOrientation: AVCaptureVideoOrientation) -> SBSDKIDCardRecognizerResult?

    Parameters

    sampleBufferRef

    The CMSampleBuffer instance to detect an ID card on.

    videoOrientation

    The orientation of the sample buffer.

    Return Value

    The detection result or nil if an error occurred.

  • Detects an ID card on an UIImage instance. Does not recognize and extract field data.

    Declaration

    Objective-C

    - (nullable SBSDKIDCardRecognizerResult *)detectIDCardOnImage:
        (nonnull UIImage *)image;

    Swift

    func detectIDCard(on image: UIImage) -> SBSDKIDCardRecognizerResult?

    Parameters

    image

    The UIImage instance to detect an ID card on.

    Return Value

    The detection result or nil if an error occurred.

  • Recognizes an ID card on a video frame. Recognizes and extracts field data.

    Declaration

    Objective-C

    - (nullable SBSDKIDCardRecognizerResult *)
        recognizeIDCardOnBuffer:(nonnull CMSampleBufferRef)sampleBufferRef
                    orientation:(AVCaptureVideoOrientation)videoOrientation;

    Swift

    func recognizeIDCard(on sampleBufferRef: CMSampleBuffer, orientation videoOrientation: AVCaptureVideoOrientation) -> SBSDKIDCardRecognizerResult?

    Parameters

    sampleBufferRef

    The CMSampleBuffer instance to recognize an ID card on.

    videoOrientation

    The orientation of the sample buffer.

    Return Value

    The recognition result or nil if an error occurred.

  • Recognizes an ID card on an UIImage instance. Recognizes and extracts field data.

    Declaration

    Objective-C

    - (nullable SBSDKIDCardRecognizerResult *)recognizeIDCardOnImage:
        (nonnull UIImage *)image;

    Swift

    func recognizeIDCard(on image: UIImage) -> SBSDKIDCardRecognizerResult?

    Parameters

    image

    The UIImage instance to recognize an ID card on.

    Return Value

    The recognition result or nil if an error occurred.