private void fetchLiveImage(object sender,DoWorkEventArgs e) { var image = e.Argument as FingerImage; FingerPicture pic = image.MakePicture(); Dispatcher.InvokeAsync(new Action(() => showImage(pic))); }
private void fetchOneImage(object sender, DoWorkEventArgs e) { var job = (WorkerJob)e.Argument; try { FingerPicture pic = null; FingerTemplate extracted = null; pic = job.Image.MakePicture(); Dispatcher.Invoke(new Action(() => checkFinger.ShowImage(pic.Image, pic.Width, pic.Height))); Dispatcher.Invoke(new Action(() => imageClearTimerStart())); extracted = job.Sender.Extract(job.Image); if (extracted != null) { job.Sender.Dispatch(COMMAND.LIVECAPTURE_STOP); if (templates.Keys.Contains(job.Sender.ToString())) { Dictionary <FingerTemplate, String> currentTemplates = templates[job.Sender.ToString()]; if (currentTemplates != null) { var candidates = currentTemplates.Keys.ToArray(); ///////////// List <FingerTemplate> matchedTemplates; foreach (var devCtrl in pluginManager.DeviceControls) { if (devCtrl.ActiveDevices.Contains(job.Sender)) { int result = devCtrl.Match(extracted, candidates, out matchedTemplates); if (result != 0) { this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (new Action(() => { if (job.Sender == currentTestDevice.Content) { checkFinger.ShowPopUp("Identified as " + currentTemplates[matchedTemplates[0]]); } } ))); } } } ///////////// } } job.Sender.Dispatch(COMMAND.LIVECAPTURE_START); } else { //Log.Error("Extracted = " + extracted.ToString()); } } catch (Exception ex) { Log.Error(ex); } }
private void fetchImage(object sender,DoWorkEventArgs e) { var image = e.Argument as FingerImage; String type; byte[] data; image.Serialize(out type,out data); Dispatcher.InvokeAsync(new Action(() => SendBio(type,Convert.ToBase64String(data)))); FingerPicture pic = image.MakePicture(); Dispatcher.InvokeAsync(new Action(() => showImage(pic))); }
private void ProcessImage(Object sender,FingerImage image) { try { if (sender == currentDevice) { FingerPicture pic = image.MakePicture(); Dispatcher.Invoke(new Action(() => showImage(pic))); } } catch (Exception e) { //Log.Info(e); } }
private void fetchImage(object sender,DoWorkEventArgs e) { var image = e.Argument as FingerImage; String type,data; Dispatcher.Invoke(new Action(() => currDevice.Dispatch(COMMAND.SINGLECAPTURE_STOP))); Thread.Sleep(250); // it's magic! image.Serialize(out type,out data); var bioData = new BioData(type,data); Dispatcher.Invoke(new Action(() => SendBio(bioData))); FingerPicture pic = image.MakePicture(); Dispatcher.Invoke(new Action(() => showImage(pic))); }
private void showImage(FingerPicture pic) { checkFinger.ShowImage(pic.Image,pic.Width,pic.Height); _nextReset = RESETER_IMAGE_LIFETIME_MS; }
private void ProcessSingle(Object sender,FingerImage image) { try { if (isBusy && !isVerifyingPalm) { return; } if (sender == currentDevice) { FingerPicture pic = image.MakePicture(); showImage(pic); if (isVerifyingPalm) { var verifyList = new List <FingerTemplate>(); verifyList.Add(currentDevice.Extract(image)); BiometricsEnrolled(this,verifyList); return; } var candidates = new ComparsionCandidates(currentCredential.fingers); ///////////// IDeviceControl currDeviceControl; List <FingerTemplate> matchedTemplates; foreach (var devCtrl in Owner.PluginManager.DeviceControls) { if (devCtrl.ActiveDevices.Contains(currentDevice)) { currDeviceControl = devCtrl; int fingerIndex = currDeviceControl.Match(currentDevice.Extract(image),candidates.Candidates.ToArray(),out matchedTemplates); if (fingerIndex == 0) { if (_controlType == ControlTypeEnum.FINGERPRINT_CONTROL_TYPE) { fingerDisplay.ShowPopUp("Finger is not registered"); } else if (_controlType == ControlTypeEnum.PALM_CONTROL_TYPE) { fingerDisplay.ShowPopUp("Palm is not registered"); } UpdateFingers(); } else { if (_controlType == ControlTypeEnum.FINGERPRINT_CONTROL_TYPE) { fingerDisplay.ShowPopUp("Finger is registered as " + FingerCredential.GetFingerName(candidates.PositionOf(matchedTemplates[0]))); fingerChooser.ShowFinger(candidates.PositionOf(matchedTemplates[0])); } else if (_controlType == ControlTypeEnum.PALM_CONTROL_TYPE) { fingerDisplay.ShowPopUp("Palm is registered as " + FingerCredential.GetFingerName(candidates.PositionOf(matchedTemplates[0]))); if (candidates.PositionOf(matchedTemplates[0]) == 10) { if (highlightedPalm == 11) { palmEnrollControl.RightStatePalmP = StatePalm.WhiteBlack; } if (palmEnrollControl.LeftStatePalmP != StatePalm.Green) { palmEnrollControl.LeftStatePalmP = StatePalm.GreenBlack; highlightedPalm = 10; } } else if (candidates.PositionOf(matchedTemplates[0]) == 11) { if (highlightedPalm == 10) { palmEnrollControl.LeftStatePalmP = StatePalm.WhiteBlack; } if (palmEnrollControl.RightStatePalmP != StatePalm.Green) { palmEnrollControl.RightStatePalmP = StatePalm.GreenBlack; highlightedPalm = 11; } } } // Reset fingers after all textReset = RESETER_TEXT_LIFETIME_MS; } } } ///////////// currentDevice.Dispatch(COMMAND.SINGLECAPTURE_START); } } catch (Exception ex) { //Log.Info(ex); } }
private void showImage(FingerPicture pic) { fingerDisplay.ShowImage(pic.Image, pic.Width, pic.Height); nextReset = RESETER_IMAGE_LIFETIME_MS; }