示例#1
0
文件: IUserDB.cs 项目: sfcheewill/Blm
 public Palm(int PalmNum, String bytes, FingerTemplate tmpl)
 {
     this.PalmNum  = PalmNum;
     this.Bytes    = bytes;
     this.Type     = tmpl.BSPCode;
     this.Template = tmpl;
 }
示例#2
0
文件: IUserDB.cs 项目: sfcheewill/Blm
 public Finger(int fingerNum, String bytes, FingerTemplate tmpl)
 {
     this.FingerNum = fingerNum;
     this.Bytes     = bytes;
     this.Type      = tmpl.BSPCode;
     this.Template  = tmpl;
 }
示例#3
0
        internal int Match(FingerTemplate template,IEnumerable <FingerTemplate> candidates,out List <FingerTemplate> matches)
        {
            Attach();
            int res = HitachiBio.Match(handle,template,candidates,out matches);

            //Detach();
            return(res);
        }
示例#4
0
        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);
            }
        }
示例#5
0
 /// <summary>
 /// Match templates
 /// </summary>
 /// <param name="template"></param>
 /// <param name="candidates"></param>
 /// <param name="matches"></param>
 /// <returns></returns>
 public int Match(FingerTemplate template, IEnumerable <FingerTemplate> candidates, out List <FingerTemplate> matches)
 {
     matches = new List <FingerTemplate>();
     foreach (var candidate in candidates)
     {
         matches.Add(candidate);
     }
     return(matches.Count());
 }
示例#6
0
        public FingerTemplate Deserialize(String type, String data)
        {
            FingerTemplate result = null;

            if (type == TemplateTypes.IBTemplate.ToString())
            {
                result = new TemplateIB(Convert.FromBase64String(data));
            }
            return(result);
        }
示例#7
0
        public FingerTemplate Deserialize(int type, byte[] data)
        {
            FingerTemplate result = null;

            if (type == TemplateTypes.IBTemplate)
            {
                result = new TemplateIB(data);
            }
            return(result);
        }
示例#8
0
 public ComparsionCandidates(List <Finger> fingers)
 {
     Candidates = new FingerTemplate[fingers.Count];
     Positions  = new int[fingers.Count];
     for (int i = 0; i < fingers.Count; i++)
     {
         Candidates[i] = fingers[i].Template;
         Positions[i]  = fingers[i].FingerNum;
     }
 }
示例#9
0
        public FingerTemplate Deserialize(int type, byte[] data)
        {
            FingerTemplate result = null;

            if (SupportedBSP.Contains(type))
            {
                result = new TemplateSG(type, data);
            }
            return(result);
        }
示例#10
0
        /// <summary>
        /// Convert byte array into fingertemplate, if possible
        /// </summary>
        /// <param name="type"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public FingerTemplate Deserialize(int bspcode, byte[] data)
        {
            FingerTemplate result = null;

            if (bspcode == BSPCode)
            {
                //TODO: decode byte[] date into FingerTemplate object
                result = new TemplateFake(data);
            }
            return(result);
        }
示例#11
0
        /// <summary>
        /// Matches the specified template.
        /// </summary>
        /// <param name="template">The template.</param>
        /// <param name="candidates">The candidates.</param>
        /// <param name="matches">The matches.</param>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public int Match(FingerTemplate template, IEnumerable <FingerTemplate> candidates, out List <FingerTemplate> matches)
        {
            var devices = ActiveDevices.OfType <DeviceHi>().Where(dev => dev.IsOnline).ToList();

            if (devices != null)
            {
                if (devices.Count > 0)
                {
                    return(devices[0].Match(template, candidates.ToList(), out matches));
                }
            }
            matches = null;
            return(0);
        }
示例#12
0
        public int Match(FingerTemplate template, IEnumerable <FingerTemplate> candidates, out List <FingerTemplate> matches)
        {
            byte[] pFp = new byte[BioNetACSDLL._GetFeatSize()];

            var        resultList = new List <FingerTemplate>();
            TemplateIB templateIB = template as TemplateIB;

            matches = new List <FingerTemplate>();

            foreach (var candidate in candidates.OfType <TemplateIB>())
            {
                int compareResult = BioNetACSDLL._CompareFt9052vs9052(candidate.enrollment, templateIB.enrollment);
                if (compareResult > 0)
                {
                    matches.Add(candidate);
                }
            }

            return(matches.Count);
        }
示例#13
0
        public int Match(FingerTemplate template, IEnumerable <FingerTemplate> candidates, out List <FingerTemplate> matches)
        {
            // extract FMD from FID
            TemplateDP templateDP = template as TemplateDP;

            matches = new List <FingerTemplate>();

            foreach (var candidate in candidates.OfType <TemplateDP>())
            {
                var identifyResult = Comparison.Compare(templateDP.fmd, 0, candidate.fmd, 0);
                if (identifyResult.ResultCode == Constants.ResultCode.DP_SUCCESS)
                {
                    if (identifyResult.Score < DP_THRESHOLD)
                    {
                        matches.Add(candidate);
                    }
                }
            }

            return(matches.Count);
        }
示例#14
0
        public int Match(FingerTemplate template, IEnumerable <FingerTemplate> candidates, out List <FingerTemplate> matches)
        {
            TemplateSG templateSG = template as TemplateSG;
            int        result     = m_FPM.SetTemplateFormat(SGFPMTemplateFormat.ANSI378);

            matches = new List <FingerTemplate>();
            foreach (var canditate in candidates.OfType <TemplateSG>())
            {
                if (canditate.BSPCode != template.BSPCode)
                {
                    continue;
                }
                bool matched = false;
                result = m_FPM.MatchTemplate(templateSG.Bytes, canditate.Bytes, SGFPMSecurityLevel.HIGH, ref matched);
                if (matched)
                {
                    matches.Add(canditate);
                }
            }

            return(matches.Count);
        }
示例#15
0
 public int PositionOf(FingerTemplate template)
 {
     return(Positions[Array.IndexOf(this.Candidates,template)]);
 }