Beispiel #1
0
        private bool MatchBetaAngles(MtiaTriplet compareTo)
        {
            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    if (i != j)
                    {
                        Minutia qMtiai  = minutiae[MtiaIdxs[i]];
                        Minutia qMtiaj  = minutiae[MtiaIdxs[j]];
                        double  x       = qMtiai.X - qMtiaj.X;
                        double  y       = qMtiai.Y - qMtiaj.Y;
                        double  angleij = Angle.ComputeAngle(x, y);
                        double  qBeta   = Angle.DifferencePi(qMtiai.Angle, angleij);

                        Minutia tMtiai = compareTo.minutiae[compareTo.MtiaIdxs[i]];
                        Minutia tMtiaj = compareTo.minutiae[compareTo.MtiaIdxs[j]];
                        x       = tMtiai.X - tMtiaj.X;
                        y       = tMtiai.Y - tMtiaj.Y;
                        angleij = Angle.ComputeAngle(x, y);
                        double tBeta = Angle.DifferencePi(tMtiai.Angle, angleij);

                        double diff = Angle.DifferencePi(qBeta, tBeta);
                        if (diff >= betaThr)
                        {
                            return(false);
                        }
                    }
                }
            }

            return(true);
        }
 private bool MatchDistances(MtiaTriplet compareTo)
 {
     double ratio = Math.Abs(d[0] - compareTo.d[0]) / Math.Min(d[0], compareTo.d[0]);
     if (ratio >= dThr)
         return false;
     ratio = Math.Abs(d[1] - compareTo.d[1]) / Math.Min(d[1], compareTo.d[1]);
     if (ratio >= dThr)
         return false;
     ratio = Math.Abs(d[2] - compareTo.d[2]) / Math.Min(d[2], compareTo.d[2]);
     if (ratio >= dThr)
         return false;
     return true;
 }
 internal List<MtiaeTripletPair> FindAllSimilar(MtiaTriplet queryMTp)
 {
     var result = new List<MtiaeTripletPair>();
     for (int j = 0; j < MTriplets.Count; j++)
     {
         MtiaTriplet currMTp = MTriplets[j];
         if (queryMTp.Match(currMTp))
             result.Add(new MtiaeTripletPair
                            {
                                queryMTp = queryMTp,
                                templateMTp = currMTp,
                            }
                 );
     }
     if (result.Count > 0)
         return result;
     return null;
 }
Beispiel #4
0
        private bool MatchDistances(MtiaTriplet compareTo)
        {
            double ratio = Math.Abs(d[0] - compareTo.d[0]) / Math.Min(d[0], compareTo.d[0]);

            if (ratio >= dThr)
            {
                return(false);
            }
            ratio = Math.Abs(d[1] - compareTo.d[1]) / Math.Min(d[1], compareTo.d[1]);
            if (ratio >= dThr)
            {
                return(false);
            }
            ratio = Math.Abs(d[2] - compareTo.d[2]) / Math.Min(d[2], compareTo.d[2]);
            if (ratio >= dThr)
            {
                return(false);
            }
            return(true);
        }
Beispiel #5
0
        internal List <MtiaeTripletPair> FindAllSimilar(MtiaTriplet queryMTp)
        {
            var result = new List <MtiaeTripletPair>();

            for (int j = 0; j < MTriplets.Count; j++)
            {
                MtiaTriplet currMTp = MTriplets[j];
                if (queryMTp.Match(currMTp))
                {
                    result.Add(new MtiaeTripletPair
                    {
                        queryMTp    = queryMTp,
                        templateMTp = currMTp,
                    }
                               );
                }
            }
            if (result.Count > 0)
            {
                return(result);
            }
            return(null);
        }
Beispiel #6
0
        private bool MatchAlphaAngles(MtiaTriplet compareTo)
        {
            var idxArr = new[] { 0, 1, 2, 0 };

            for (int i = 0; i < 3; i++)
            {
                int     j      = idxArr[i + 1];
                Minutia qMtiai = minutiae[MtiaIdxs[i]];
                Minutia qMtiaj = minutiae[MtiaIdxs[j]];
                double  qAlpha = Angle.DifferencePi(qMtiai.Angle, qMtiaj.Angle);

                Minutia tMtiai = compareTo.minutiae[compareTo.MtiaIdxs[i]];
                Minutia tMtiaj = compareTo.minutiae[compareTo.MtiaIdxs[j]];
                double  tAlpha = Angle.DifferencePi(tMtiai.Angle, tMtiaj.Angle);

                double diff = Angle.DifferencePi(qAlpha, tAlpha);
                if (diff >= alphaThr)
                {
                    return(false);
                }
            }

            return(true);
        }
Beispiel #7
0
 internal bool Match(MtiaTriplet target)
 {
     return(MatchDistances(target) && MatchAlphaAngles(target) && MatchBetaAngles(target));
 }
        private bool MatchAlphaAngles(MtiaTriplet compareTo)
        {
            var idxArr = new[] { 0, 1, 2, 0 };
            for (int i = 0; i < 3; i++)
            {
                int j = idxArr[i + 1];
                Minutia qMtiai = minutiae[MtiaIdxs[i]];
                Minutia qMtiaj = minutiae[MtiaIdxs[j]];
                double qAlpha = Angle.DifferencePi(qMtiai.Angle, qMtiaj.Angle);

                Minutia tMtiai = compareTo.minutiae[compareTo.MtiaIdxs[i]];
                Minutia tMtiaj = compareTo.minutiae[compareTo.MtiaIdxs[j]];
                double tAlpha = Angle.DifferencePi(tMtiai.Angle, tMtiaj.Angle);

                double diff = Angle.DifferencePi(qAlpha, tAlpha);
                if (diff >= alphaThr)
                    return false;
            }

            return true;
        }
 internal bool Match(MtiaTriplet target)
 {
     return MatchDistances(target) && MatchAlphaAngles(target) && MatchBetaAngles(target);
 }
        private bool MatchBetaAngles(MtiaTriplet compareTo)
        {
            for (int i = 0; i < 3; i++)
                for (int j = 0; j < 3; j++)
                    if (i != j)
                    {
                        Minutia qMtiai = minutiae[MtiaIdxs[i]];
                        Minutia qMtiaj = minutiae[MtiaIdxs[j]];
                        double x = qMtiai.X - qMtiaj.X;
                        double y = qMtiai.Y - qMtiaj.Y;
                        double angleij = Angle.ComputeAngle(x, y);
                        double qBeta = Angle.DifferencePi(qMtiai.Angle, angleij);

                        Minutia tMtiai = compareTo.minutiae[compareTo.MtiaIdxs[i]];
                        Minutia tMtiaj = compareTo.minutiae[compareTo.MtiaIdxs[j]];
                        x = tMtiai.X - tMtiaj.X;
                        y = tMtiai.Y - tMtiaj.Y;
                        angleij = Angle.ComputeAngle(x, y);
                        double tBeta = Angle.DifferencePi(tMtiai.Angle, angleij);

                        double diff = Angle.DifferencePi(qBeta, tBeta);
                        if (diff >= betaThr)
                            return false;
                    }

            return true;
        }