예제 #1
0
 public void BuildIndex(Template probe, ProbeIndex index)
 {
     index.Template = probe;
     index.Edges = ParameterSet.ClonePrototype(EdgeTablePrototype);
     index.Edges.Reset(probe);
     index.EdgeHash = new EdgeHash(probe, EdgeLookup);
 }
예제 #2
0
 public IEnumerable <MinutiaPair> GetRoots(ProbeIndex probeIndex, Template candidateTemplate)
 {
     LookupCounter = 0;
     HashLookup.Reset(probeIndex.EdgeHash);
     return(GetFilteredRoots(probeIndex, candidateTemplate, shape => shape.Length >= MinEdgeLength)
            .Concat(GetFilteredRoots(probeIndex, candidateTemplate, shape => shape.Length < MinEdgeLength)));
 }
예제 #3
0
 public IEnumerable<MinutiaPair> GetRoots(ProbeIndex probeIndex, Template candidateTemplate)
 {
     LookupCounter = 0;
     HashLookup.Reset(probeIndex.EdgeHash);
     return GetFilteredRoots(probeIndex, candidateTemplate, shape => shape.Length >= MinEdgeLength)
         .Concat(GetFilteredRoots(probeIndex, candidateTemplate, shape => shape.Length < MinEdgeLength));
 }
예제 #4
0
 public IEnumerable<MinutiaPair> GetFilteredRoots(ProbeIndex probeIndex, Template candidateTemplate, Predicate<EdgeShape> shapeFilter)
 {
     if (LookupCounter >= MaxEdgeLookups)
         yield break;
     var edgeConstructor = new EdgeConstructor();
     for (int step = 1; step < candidateTemplate.Minutiae.Length; ++step)
         for (int pass = 0; pass < step + 1; ++pass)
             for (int candidateReference = pass; candidateReference < candidateTemplate.Minutiae.Length; candidateReference += step + 1)
             {
                 int candidateNeighbor = (candidateReference + step) % candidateTemplate.Minutiae.Length;
                 var candidateEdge = edgeConstructor.Construct(candidateTemplate, candidateReference, candidateNeighbor);
                 if (shapeFilter(candidateEdge))
                 {
                     for (var match = HashLookup.Select(candidateEdge); match != null; match = HashLookup.Next())
                     {
                         var pair = new MinutiaPair(match.Location.Reference, candidateReference);
                         if (Logger.IsActive)
                             Logger.Log(pair);
                         yield return pair;
                         ++LookupCounter;
                         if (LookupCounter >= MaxEdgeLookups)
                             yield break;
                     }
                 }
             }
 }
예제 #5
0
 public void BuildIndex(Template probe, ProbeIndex index)
 {
     index.Template = probe;
     index.Edges    = ParameterSet.ClonePrototype(EdgeTablePrototype);
     index.Edges.Reset(probe);
     index.EdgeHash = new EdgeHash(probe, EdgeLookup);
 }
예제 #6
0
        public IEnumerable <MinutiaPair> GetFilteredRoots(ProbeIndex probeIndex, Template candidateTemplate, Predicate <EdgeShape> shapeFilter)
        {
            if (LookupCounter >= MaxEdgeLookups)
            {
                yield break;
            }
            var edgeConstructor = new EdgeConstructor();

            for (int step = 1; step < candidateTemplate.Minutiae.Length; ++step)
            {
                for (int pass = 0; pass < step + 1; ++pass)
                {
                    for (int candidateReference = pass; candidateReference < candidateTemplate.Minutiae.Length; candidateReference += step + 1)
                    {
                        int candidateNeighbor = (candidateReference + step) % candidateTemplate.Minutiae.Length;
                        var candidateEdge     = edgeConstructor.Construct(candidateTemplate, candidateReference, candidateNeighbor);
                        if (shapeFilter(candidateEdge))
                        {
                            for (var match = HashLookup.Select(candidateEdge); match != null; match = HashLookup.Next())
                            {
                                var pair = new MinutiaPair(match.Location.Reference, candidateReference);
                                if (Logger.IsActive)
                                {
                                    Logger.Log(pair);
                                }
                                yield return(pair);

                                ++LookupCounter;
                                if (LookupCounter >= MaxEdgeLookups)
                                {
                                    yield break;
                                }
                            }
                        }
                    }
                }
            }
        }
예제 #7
0
 public void SelectProbe(ProbeIndex probe)
 {
     Probe = probe;
     Pairing.SelectProbe(probe.Template);
     CandidateEdges = ParameterSet.ClonePrototype(EdgeTablePrototype);
 }
예제 #8
0
 public void SelectProbe(ProbeIndex probe)
 {
     Probe = probe;
     Pairing.SelectProbe(probe.Template);
     CandidateEdges = ParameterSet.ClonePrototype(EdgeTablePrototype);
 }