这是应用中使用的代码,
//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: {
})
}
})
}
}
即使我们使用其他人的美国驾驶执照进行扫描,也总是会成功进入if语句。
答案 0 :(得分:0)
这是因为MBUSDLCombinedRecognizer仅扫描正面的人脸和文档图像。 它不会读取字段,所有其他字段都是从背面的pdf417条形码读取的,因此它无法比较正面和背面的结果。 我们正在努力为USDL的前端提供支持,在2019年第二季度,我们将获得一些令人振奋的消息!一个小提示:Autodetection
亲切的问候