Scanning a machine-readable zone from an image
MRZ Scanner also has the ability to perform detection on a static image.
It quickly analysis the image and identify any MRZ present within it.
Once the detection is done, the scanner returns the result of type SBSDKMachineReadableZoneRecognizerResult
.
Example for detecting MRZ on the Image
- Swift
- Objective-C
import Foundation
import ScanbotSDK
func detectMRZOnImage() {
// Image containing MRZ.
guard let image = UIImage(named: "mrzImage") else { return }
// Creates an instance of `SBSDKMachineReadableZoneRecognizer`.
let detector = SBSDKMachineReadableZoneRecognizer()
// Returns the result after running detector on the image.
let result = detector.recognizePersonalIdentity(from: image)
}
#import "MRZDetectionOnImage.h"
@import ScanbotSDK;
@implementation MRZDetectionOnImage
- (void) detectMRZOnImage {
// Image containing MRZ.
UIImage *image = [UIImage imageNamed:@"mrzImage"];
// Creates an instance of `SBSDKMachineReadableZoneRecognizer`.
SBSDKMachineReadableZoneRecognizer *detector = [[SBSDKMachineReadableZoneRecognizer alloc] init];
// Returns the result after running detector on the image.
SBSDKMachineReadableZoneRecognizerResult *result = [detector recognizePersonalIdentityFromImage:image];
}
@end
Want to scan longer than one minute?
Generate a free trial license to test the Scanbot SDK thoroughly.
Get your free Trial LicenseWhat do you think of this documentation?
What can we do to improve it? Please be as detailed as you like.