protected override void worker_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                setGreenLed(false);
                setRedLed(true);

                var localImage = e.Argument as Image;
                var fps        = new List <Fingerprint>();

                int count = _twoprint.Segmentation(localImage);
                Console.WriteLine("GetSegmentationCount: " + count);
                for (int i = 0; i < count; i++)
                {
                    var segment = _twoprint.GetSegmentedImageEx(i);
                    fps.Add(ProcessImage(segment.Image, segment.ImageData, (uint)segment.Index));
                }

                setGreenLed(true);
                setRedLed(false);

                base.InvokeFingerprintsDetected(fps);
            }
            catch (Exception ex)
            {
                InvokeScannerError(sender, new ScannerErrorEventArgs("Processing error: " + ex.Message, ex));
            }
        }
Example #2
0
        protected override void worker_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                setGreenLed(false);
                setRedLed(true);

                var localImage = e.Argument as Image;
                var fps        = new List <Fingerprint>();

                int count = _twoprint.Segmentation(localImage);
                Console.WriteLine("GetSegmentationCount: " + count);
                for (int i = 0; i < count; i++)
                {
                    var segment = _twoprint.GetSegmentedImageEx(i);

                    Fingerprint fp = new Fingerprint();
                    fp.Image    = segment.Image;
                    fp.Template = base.Encoder.Encode(segment.Image);
                    fp.NFIQ     = DermalogNistQualityCheck.Check(segment.Image);

                    fps.Add(fp);
                }

                setGreenLed(true);
                setRedLed(false);

                base.InvokeFingerprintsDetected(fps);
            }
            catch (Exception ex)
            {
                InvokeScannerError(sender, new ScannerErrorEventArgs("Processing error: " + ex.Message, ex));
            }
        }