void BuildPairing() { while (true) { CollectEdges(); SkipPaired(); if (PairQueue.Count == 0) { break; } AddPair(PairQueue.Dequeue()); } }
public void SkipPaired(MinutiaPairing pairing) { while (Queue.Count > 0 && (pairing.IsProbePaired(Queue.Peek().Neighbor.Probe) || pairing.IsCandidatePaired(Queue.Peek().Neighbor.Candidate))) { EdgePair edge = Queue.Dequeue(); if (pairing.IsProbePaired(edge.Neighbor.Probe) && pairing.GetByProbe(edge.Neighbor.Probe).Pair.Candidate == edge.Neighbor.Candidate) { pairing.AddSupportByProbe(edge.Reference.Probe); pairing.AddSupportByProbe(edge.Neighbor.Probe); } } }
public void Filter(SkeletonBuilder skeleton) { PriorityQueueF<Gap> queue = new PriorityQueueF<Gap>(); foreach (SkeletonBuilder.Minutia end1 in skeleton.Minutiae) if (end1.Ridges.Count == 1 && end1.Ridges[0].Points.Count >= MinEndingLength) foreach (SkeletonBuilder.Minutia end2 in skeleton.Minutiae) if (end2 != end1 && end2.Ridges.Count == 1 && end1.Ridges[0].End != end2 && end2.Ridges[0].Points.Count >= MinEndingLength && IsWithinLimits(end1, end2)) { Gap gap; gap.End1 = end1; gap.End2 = end2; queue.Enqueue(Calc.DistanceSq(end1.Position, end2.Position), gap); } BinaryMap shadow = SkeletonShadow.Draw(skeleton); while (queue.Count > 0) { Gap gap = queue.Dequeue(); if (gap.End1.Ridges.Count == 1 && gap.End2.Ridges.Count == 1) { Point[] line = Calc.ConstructLine(gap.End1.Position, gap.End2.Position); if (!IsOverlapping(line, shadow)) AddRidge(skeleton, shadow, gap, line); } } KnotRemover.Filter(skeleton); Logger.Log(skeleton); }
private void RemoveGaps() { const int minEndingLength = 7; var queue = new PriorityQueueF <Gap>(); foreach (var end1 in Minutiae) { if (end1.Ridges.Count == 1 && end1.Ridges[0].Points.Count >= minEndingLength) { foreach (var end2 in Minutiae) { if (end2 != end1 && end2.Ridges.Count == 1 && end1.Ridges[0].End != end2 && end2.Ridges[0].Points.Count >= minEndingLength && IsWithinGapLimits(end1, end2)) { Gap gap; gap.End1 = end1; gap.End2 = end2; queue.Enqueue((end1.Position - end2.Position).SqLength, gap); } } } } var shadow = GetShadow(); while (queue.Count > 0) { var gap = queue.Dequeue(); if (gap.End1.Ridges.Count == 1 && gap.End2.Ridges.Count == 1) { var line = MathEx.ConstructLine(gap.End1.Position, gap.End2.Position); if (!IsRidgeOverlapping(line, shadow)) { AddGapRidge(shadow, gap, line); } } } RemoveKnots(); }
public void Filter(SkeletonBuilder skeleton) { PriorityQueueF <Gap> queue = new PriorityQueueF <Gap>(); foreach (SkeletonBuilder.Minutia end1 in skeleton.Minutiae) { if (end1.Ridges.Count == 1 && end1.Ridges[0].Points.Count >= MinEndingLength) { foreach (SkeletonBuilder.Minutia end2 in skeleton.Minutiae) { if (end2 != end1 && end2.Ridges.Count == 1 && end1.Ridges[0].End != end2 && end2.Ridges[0].Points.Count >= MinEndingLength && IsWithinLimits(end1, end2)) { Gap gap; gap.End1 = end1; gap.End2 = end2; queue.Enqueue(Calc.DistanceSq(end1.Position, end2.Position), gap); } } } } BinaryMap shadow = SkeletonShadow.Draw(skeleton); while (queue.Count > 0) { Gap gap = queue.Dequeue(); if (gap.End1.Ridges.Count == 1 && gap.End2.Ridges.Count == 1) { Point[] line = Calc.ConstructLine(gap.End1.Position, gap.End2.Position); if (!IsOverlapping(line, shadow)) { AddRidge(skeleton, shadow, gap, line); } } } KnotRemover.Filter(skeleton); Logger.Log(skeleton); }
void RemoveGaps() { const int minEndingLength = 7; PriorityQueueF<Gap> queue = new PriorityQueueF<Gap>(); foreach (SkeletonMinutia end1 in Minutiae) if (end1.Ridges.Count == 1 && end1.Ridges[0].Points.Count >= minEndingLength) foreach (SkeletonMinutia end2 in Minutiae) if (end2 != end1 && end2.Ridges.Count == 1 && end1.Ridges[0].End != end2 && end2.Ridges[0].Points.Count >= minEndingLength && IsWithinGapLimits(end1, end2)) { Gap gap; gap.End1 = end1; gap.End2 = end2; queue.Enqueue((end1.Position - end2.Position).SqLength, gap); } var shadow = GetShadow(); while (queue.Count > 0) { Gap gap = queue.Dequeue(); if (gap.End1.Ridges.Count == 1 && gap.End2.Ridges.Count == 1) { Point[] line = MathEx.ConstructLine(gap.End1.Position, gap.End2.Position); if (!IsRidgeOverlapping(line, shadow)) AddGapRidge(shadow, gap, line); } } RemoveKnots(); }