/// <summary> /// Button click event handler that will start the scanning procedure. /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">E.</param> void StartScan(object sender, EventArgs e) { // license keys must be set before creating Recognizer, othervise InvalidLicenseKeyException will be thrown // the following code creates and sets up implementation of MrtdRecognizer blinkidRecognizer = DependencyService.Get <IBlinkIdCombinedRecognizer>(DependencyFetchTarget.NewInstance); blinkidRecognizer.ReturnFullDocumentImage = true; // the following code creates and sets up implementation of UsdlRecognizer //usdlRecognizer = DependencyService.Get<IUsdlRecognizer>(DependencyFetchTarget.NewInstance); // success frame grabber recognizer must be constructed with reference to its slave recognizer, // so we need to use factory to avoid DependencyService's limitations //usdlSuccessFrameGrabberRecognizer = DependencyService.Get<ISuccessFrameGrabberRecognizerFactory>(DependencyFetchTarget.NewInstance).CreateSuccessFrameGrabberRecognizer(usdlRecognizer); // first create a recognizer collection from all recognizers that you want to use in recognition // if some recognizer is wrapped with SuccessFrameGrabberRecognizer, then you should use only the wrapped one var recognizerCollection = DependencyService.Get <IRecognizerCollectionFactory>().CreateRecognizerCollection(blinkidRecognizer /*, usdlSuccessFrameGrabberRecognizer*/); // using recognizerCollection, create overlay settings that will define the UI that will be used // there are several available overlay settings classes in Microblink.Forms.Core.Overlays namespace // document overlay settings is best for scanning identity documents var blinkidOverlaySettings = DependencyService.Get <IBlinkIdOverlaySettingsFactory>().CreateBlinkIdOverlaySettings(recognizerCollection); // start scanning blinkID.Scan(blinkidOverlaySettings); }
private void ScanPassport() { IRecognizerCollection recognizerCollection = DependencyService.Get <IRecognizerCollectionFactory>().CreateRecognizerCollection(mrtdSuccessFrameGrabberRecognizer); var documentOverlaySettings = DependencyService.Get <IDocumentOverlaySettingsFactory>().CreateDocumentOverlaySettings(recognizerCollection); // start scanning blinkID.Scan(documentOverlaySettings); }
/// <summary> /// Button click event handler that will start the scanning procedure. /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">E.</param> void StartScan(object sender, EventArgs e) { // first create a recognizer collection from all recognizers that you want to use in recognition // if some recognizer is wrapped with SuccessFrameGrabberRecognizer, then you should use only the wrapped one var recognizerCollection = DependencyService.Get <IRecognizerCollectionFactory>().CreateRecognizerCollection(mrtdSuccessFrameGrabberRecognizer, usdlSuccessFrameGrabberRecognizer, eudlSuccessFrameGrabberRecognizer); // using recognizerCollection, create overlay settings that will define the UI that will be used // there are several available overlay settings classes in Microblink.Forms.Core.Overlays namespace // document overlay settings is best for scanning identity documents var documentOverlaySettings = DependencyService.Get <IDocumentOverlaySettingsFactory>().CreateDocumentOverlaySettings(recognizerCollection); // start scanning blinkID.Scan(documentOverlaySettings); }