예제 #1
0
        public FingerTemplate Deserialize(int type, byte[] data)
        {
            FingerTemplate result = null;

            if (type == TemplateTypes.DPTemplate)
            {
                result = new TemplateDP(TemplateDP.Deserialize(data));
            }
            return(result);
        }
예제 #2
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);
        }