SBSDKMachineReadableZoneRecognizer

@interface SBSDKMachineReadableZoneRecognizer : NSObject

Wrapper class for machine-readable zones recognition. Recognition is performed on still UIImage or SampleBufferRef, result is incapsulated in SBSDKMRZRecognizerResult instance. NOTE: In order to operate, this class requires tesseract languages and trained data to be present in application bundle

  • Acquire all available information from UIImage instance containing machine-readable zone.

    Declaration

    Objective-C

    - (nonnull SBSDKMachineReadableZoneRecognizerResult *)
        recognizePersonalIdentityFromImage:(nonnull UIImage *)image;

    Swift

    func recognizePersonalIdentity(from image: UIImage) -> SBSDKMachineReadableZoneRecognizerResult

    Parameters

    image

    The image where machine-readable zone is to be detected.

    Return Value

    Recognizer result.

  • Acquire all available information from sample buffer reference containing machine-readable zone.

    Declaration

    Objective-C

    - (nonnull SBSDKMachineReadableZoneRecognizerResult *)
        recognizePersonalIdentityFromSampleBuffer:
            (nonnull CMSampleBufferRef)sampleBufferRef
                                      orientation:(AVCaptureVideoOrientation)
                                                      videoOrientation
                        searchMachineReadableZone:(BOOL)searchMachineReadableZone
                          machineReadableZoneRect:(CGRect)machineReadableZoneRect;

    Swift

    func recognizePersonalIdentity(from sampleBufferRef: CMSampleBuffer, orientation videoOrientation: AVCaptureVideoOrientation, searchMachineReadableZone: Bool, machineReadableZoneRect: CGRect) -> SBSDKMachineReadableZoneRecognizerResult

    Parameters

    sampleBufferRef

    The sample buffer reference containing machine-readable zone.

    videoOrientation

    Video frame orientation.

    searchMachineReadableZone

    Set to YES to automatically search machine-readable zone in provided sample buffer reference. Set to NO to manually provide the rectangle where machine-readable zone is present.

    machineReadableZoneRect

    Rectangle in frame containing machine-readable zone. Used only when searchMachineReadableZone is set to NO.

    Return Value

    Recognizer result.