VIZ MRZ Comparison Verifier

Defined in package com.scandit.datacapture.id.verification.vizmrz

VizMrzComparisonCheckResult

Added in version 6.18.0

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

PASSED

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.

FAILED

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.

SKIPPED

Added in version 6.18.0

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

VizMrzComparisonCheck
interface VizMrzComparisonCheck<@NonNull T>

Added in version 6.18.0

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

checkResult
VizMrzComparisonCheckResult getCheckResult()

Added in version 6.18.0

Whether any suspicious divergence in data is detected.

resultDescription
@NonNull String getResultDescription()

Added in version 6.18.0

The human-readable result of the comparison.

vizValue
@NonNull T getVizValue()

Added in version 6.18.0

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

mrzValue
@NonNull T getMrzValue()

Added in version 6.18.0

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

VizMrzComparisonResult
class VizMrzComparisonResult

Added in version 6.18.0

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

checksPassed
boolean getChecksPassed()

Added in version 6.18.0

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

fullNamesMatch
@NonNull VizMrzComparisonCheck<@NonNull String> getFullNamesMatch()

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
@NonNull VizMrzComparisonCheck<@NonNull String> getDocumentNumbersMatch()

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
@NonNull VizMrzComparisonCheck<@NonNull DateResult> getDatesOfBirthMatch()

Added in version 6.18.0

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

datesOfExpiryMatch
@NonNull VizMrzComparisonCheck<@NonNull DateResult> getDatesOfExpiryMatch()

Added in version 6.18.0

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

issuingCountryIsoMatch
@NonNull VizMrzComparisonCheck<@NonNull String> getIssuingCountryIsoMatch()

Added in version 6.18.0

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

resultDescription
@NonNull String getResultDescription()

Added in version 6.18.0

The human-readable result of the verification.

toJson()
@NonNull String toJson()

Added in version 6.18.0

Returns the JSON representation of this object.

VizMrzComparisonVerifier
class VizMrzComparisonVerifier

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 IdCapture with the following settings:

DataCaptureContext dataCaptureContext = DataCaptureContext.forLicenseKey("-- ENTER YOUR SCANDIT LICENSE KEY HERE --");

VizMrzComparisonVerifier verifier = VizMrzComparisonVerifier.create();

IdCaptureSettings settings = new IdCaptureSettings();
settings.setSupportedDocuments(IdDocumentType.ID_CARD_VIZ);
settings.setSupportedSides(SupportedSides.FRONT_AND_BACK);

IdCapture idCapture = IdCapture.create(dataCaptureContext, 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:

@override
void didCaptureId(IdCapture idCapture, IdCaptureSession session) {
    CapturedId capturedId = session.getNewlyCapturedId();
    VizResult viz = capturedId.getViz();
    MrzResult mrz = capturedId.getMrz();

    if (viz != null && viz.getCapturedSides() == SupportedSides.FRONT_AND_BACK && mrz != null) {
        VizMrzComparisonResult 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 VIZ 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 VizMrzComparisonResult for details.

create()
static @NonNull VizMrzComparisonVerifier create()

Added in version 6.18.0

Creates a new instance of this verifier.

create(context)
static @NonNull VizMrzComparisonVerifier create(@NonNull DataCaptureContext context)

Added in version 6.22.0

Creates a new instance of this verifier.

verify(capturedId)
@NonNull VizMrzComparisonResult verify(@NonNull CapturedId 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.