在此处使用的代码,
//setup recognizer
let usdlRecognizer = MBUsdlCombinedRecognizer()
usdlRecognizer.returnFullDocumentImage = true
usdlRecognizer.scanUncertain = false
// delegate
func documentVerificationOverlayViewControllerDidFinishScanning(_ documentVerificationOverlayViewController: MBDocumentVerificationOverlayViewController, state: MBRecognizerResultState) {
if state == MBRecognizerResultState.valid {
// first, pause scanning until we process all the results
documentVerificationOverlayViewController.recognizerRunnerViewController?.pauseScanning()
DispatchQueue.main.async(execute: {() -> Void in
documentVerificationOverlayViewController.dismiss(animated: false, completion: {
})
self.parseResult(recognizer: self.recognizer)
if let recognizer = self.recognizer as? MBUsdlCombinedRecognizer, recognizer.result.documentDataMatch == true {
// *********** Its always coming here even with mismatched cards ****************
print("both sides of cards matched.. success")
} else {
showAlert(title: "Error", message: "Data not matched", vc: self, okAction: {
})
}
})
}
}
即使我们使用不同人的美国驾驶执照扫描,它也将始终取得成功的范围。
那是因为mbusdlcombinedRognizer仅在正面扫描面部和文档图像。它没有读取字段,所有其他字段均在背面的PDF417条形码中读取,因此无法比较前面和背面的结果。我们正在为USDL的前侧提供支持,在2019年第2季度,我们将有一些令人兴奋的消息!一个小提示:自动检测
善意