VIZ MRZ Comparison Verifier

Defined in framework ScanditIdCapture

SDCVizMrzComparisonCheckResult

Added in version 6.18.0

The result of a comparison done by SDCVizMrzComparisonVerifier of a single piece of data from a personal identification document with a VIZ and an MRZ.

SDCVizMrzComparisonCheckResultPassed

Added in version 6.18.0

The compared data matches. In some instances the check may permit minor data divergence, to compensate, for example, for a single character misread by OCR.

SDCVizMrzComparisonCheckResultFailed

Added in version 6.18.0

Some suspicious differences detected. This doesn’t automatically mean that the document is fraudulent, but such document should be inspected more carefully.

SDCVizMrzComparisonCheckResultSkipped

Added in version 6.18.0

The data necessary to perform the check is missing and thus it is skipped.

SDCVizMrzComparisonCheck
@protocol SDCVizMrzComparisonCheck <NSObject>

Added in version 6.18.0

A comparison done by SDCVizMrzComparisonVerifier of a single piece of data from a personal identification document with a VIZ and an MRZ.

checkResult
@property (nonatomic, readonly) SDCVizMrzComparisonCheckResult checkResult

Added in version 6.18.0

Whether any suspicious divergence in data is detected.

resultDescription
@property (nonatomic, nonnull, readonly) NSString *resultDescription

Added in version 6.18.0

The human-readable result of the comparison.

SDCVizMrzStringComparisonCheck
@interface SDCVizMrzStringComparisonCheck : NSObject <SDCVizMrzComparisonCheck>

Added in version 6.18.0

The result of the comparison of a string field performed by SDCVizMrzComparisonVerifier. Check SDCVizMrzComparisonCheck for more information.

mrzValue
@property (nonatomic, nullable, readonly) NSString *mrzValue

Added in version 6.18.0

The string field extracted from the MRZ present at the front or the back side of a personal identification document with a VIZ and an MRZ.

vizValue
@property (nonatomic, nullable, readonly) NSString *vizValue

Added in version 6.18.0

The string field extracted from the human-readable zone of a personal identification document with a VIZ and an MRZ.

SDCVizMrzDateComparisonCheck
@interface SDCVizMrzDateComparisonCheck : NSObject <SDCVizMrzComparisonCheck>

Added in version 6.18.0

The result of the comparison of a SDCDateResult field performed by SDCVizMrzComparisonVerifier. Check SDCVizMrzComparisonCheck for more information.

mrzValue
@property (nonatomic, nullable, readonly) SDCDateResult *mrzValue

Added in version 6.18.0

The SDCDateResult field extracted from the MRZ present at the front or the back side of a personal identification document with a VIZ and an MRZ.

vizValue
@property (nonatomic, nullable, readonly) SDCDateResult *vizValue

Added in version 6.18.0

The SDCDateResult field extracted from the human-readable zone of a personal identification document with a VIZ and an MRZ.

SDCVizMrzComparisonResult
@interface SDCVizMrzComparisonResult : NSObject

Added in version 6.18.0

The result of a personal identification document with a VIZ and an MRZ verification conducted by SDCVizMrzComparisonVerifier.

checksPassed
@property (nonatomic, readonly) BOOL checksPassed

Added in version 6.18.0

Whether all the checks conducted by the verifier passed. Only the check that were run count, so YES is returned even if some of the checks were skipped.

fullNamesMatch
@property (nonatomic, readonly) SDCVizMrzStringComparisonCheck *fullNamesMatch

Added in version 6.18.0

Whether the holder’s full names extracted from both sources of the data match. This check may permit minor data divergence, to compensate, for example, for a single character misread by OCR.

documentNumbersMatch
@property (nonatomic, readonly) SDCVizMrzStringComparisonCheck *documentNumbersMatch

Added in version 6.18.0

Whether the document numbers extracted from both sources of the data match. This check may permit minor data divergence, to compensate, for example, for a single character misread by OCR.

datesOfBirthMatch
@property (nonatomic, readonly) SDCVizMrzDateComparisonCheck *datesOfBirthMatch

Added in version 6.18.0

Whether the holder’s dates of birth extracted from both sources of the data are the same.

datesOfExpirationMatch
@property (nonatomic, readonly) SDCVizMrzDateComparisonCheck *datesOfExpirationMatch

Added in version 6.18.0

Whether the document’s dates of expiry extracted from both sources of the data are the same.

issuingCountryISOMatch
@property (nonatomic, readonly) SDCVizMrzStringComparisonCheck *issuingCountryISOMatch

Added in version 6.18.0

Whether the issuing countries extracted from both sources of the data are the same.

resultDescription
@property (nonatomic, nonnull, readonly) NSString *resultDescription

Added in version 6.18.0

The human-readable result of the verification.

JSONString
@property (nonatomic, readonly) NSString *JSONString

Added in version 6.18.0

Returns the JSON representation of this object.

SDCVizMrzComparisonVerifier
@interface SDCVizMrzComparisonVerifier : NSObject

Added in version 6.18.0

Verifies a personal identification document with a VIZ and an MRZ by comparing the human-readable data of the document with the data encoded in the MRZ, and signals any suspicious differences.

The verifier may permit minor data divergence, to compensate, for example, for a single character misread by OCR. Thus, while it automatically detects many fraudulent documents, a failed check does not necessary mean that the document is invalid. It is up to the user to subject such documents to additional scrutiny.

Create the verifier and initialize SDCIdCapture with the following settings:

let dataCaptureContext = DataCaptureContext(licenseKey: "-- ENTER YOUR SCANDIT LICENSE KEY HERE --")

let verifier = VizMrzComparisonVerifier()

let settings = IdCaptureSettings()
settings.supportedDocuments = [ .idCardVIZ ]
settings.supportedSides = .frontAndBack

let idCapture = IdCapture(context: dataCaptureContext, settings: settings)

Then proceed to capture the front side & the back side of a document as usual. After you capture the back side and receive the combined result for both sides, you may run the verifier as follows:

func idCapture(_ idCapture: IdCapture, didCaptureIn session: IdCaptureSession, frameData: FrameData) {
    guard let capturedId = session.newlyCapturedId,
        let vizResult = capturedId.vizResult,
        let _ = capturedId.mrzResult,
        vizResult.capturedSides == .frontAndBack
    else { return }

    let result = verifier.verify(capturedId)

    if result.checksPassed {
        // Nothing suspicious was detected.
    } else {
        // You may inspect the results of individual checks, if you wish:
        if (result.datesOfBirthMatch.checkResult == .failed) {
          // The holder’s date of birth from the front side does not match the one encoded in the MRZ.
        }
    }
}

The return value allows you to query both the overall result of the verification and the results of individual checks. See SDCVizMrzComparisonResult for details.

+ verifier
+ (nonnull instancetype)verifier

Added in version 6.18.0

Creates a new instance of this verifier.

- verify:
- (nonnull SDCVizMrzComparisonResult *)verify:(nonnull SDCCapturedId *)capturedId

Added in version 6.18.0

Compares the human-readable data of the document with the data encoded in the MRZ, and signals any suspicious differences.