private Bitmap MatchMinuties(Bitmap bitmap, MinutiaWektor wektor)
        {
            Bitmap final = (Bitmap)bitmap.Clone();

            foreach (var p in wektor.m)
            {
                for (int i = p.p.X - 1; i < p.p.X + 1; i++)
                {
                    for (int j = p.p.Y - 1; j < p.p.Y + 1; j++)
                    {
                        if (i < final.Width && i > 0 && j < final.Height && j > 0)
                        {
                            if (p.kind.Equals(KindOfMinutia.ZAKONCZENIE))
                            {
                                final.SetPixel(i, j, Color.Orange);
                            }

                            else
                            {
                                final.SetPixel(i, j, Color.Purple);
                            }
                        }
                    }
                }
            }

            return(final);
        }
        private void Test(object sender, RoutedEventArgs e)
        {
            MinutiaWektor       wektor            = database.mBase[1].MinutiaesWektor;
            ModyficationElement przesuniecie      = new ModyficationElement(0, 0, 10);
            MinutiaWektor       przesunietyWektor = new MinutiaWektorComperer().MapMinutiaWektor(wektor, przesuniecie);
            Bitmap b = (Bitmap)orginalBitmap.Clone();

            b             = MatchMinuties(b, przesunietyWektor);
            QUATRE.Source = ImageSupporter.Bitmap2BitmapImage(b);
        }
        private void CheckSimillar(object sender, RoutedEventArgs e)
        {
            int             index  = DatabaseList.Items.IndexOf(sender);
            DatabaseElement chosen = databaseList[index];


            MinutiaWektor zbazy = database.mBase[index].MinutiaesWektor;

            temporaryMinutiasMap = zbazy;
            CheckWithDatabase(sender, e);
        }
コード例 #4
0
        public MinutiaWektor MapMinutiaWektor(MinutiaWektor mw, ModyficationElement me)//działa poprawnie sprawdzone
        {
            MinutiaWektor newMinutiaWektor = new MinutiaWektor();

            foreach (var item in mw.m)
            {
                newMinutiaWektor.Add(MapMinutia(item, me));
            }

            return(newMinutiaWektor);
        }
コード例 #5
0
        //główna funkcja w klasie porównująca podobieństwo dwóch odciski palca na podstawie ich wektorów minucji
        //dane wejściowe: jeden z odcisków z bazy danych i nowy, analizowany odcisk
        //wyjście: true lub fals decyzja czy odciski są tożsame czy też nie
        public Tuple <bool, int, ModyficationElement, int> Compere(MinutiaWektor databaseMinutia, MinutiaWektor n)
        {
            ClearAcumulator();
            Voting(databaseMinutia, n);
            Tuple <ModyficationElement, int> tuple = BestModyficationChecking();
            ModyficationElement best       = tuple.Item1;
            int           votingCount      = tuple.Item2;
            MinutiaWektor newMinutiaWektor = MapMinutiaWektor(n, best);
            int           count            = HowManyIdenticalMinuties(databaseMinutia, newMinutiaWektor);

            return(new Tuple <bool, int, ModyficationElement, int>(true, count, best, votingCount));
        }
        public void MinutiaFromPixcel(int x, int y)
        {
            MinutiaWektor mw = database.mBase[chossenDatabaseElement].MinutiaesWektor;

            foreach (var item in mw.m)
            {
                if (Math.Abs(item.p.X - x) < 3 && Math.Abs(item.p.Y - y) < 3)
                {
                    int index = mw.m.FindIndex(a => a == item);
                    Console.WriteLine("Minutia: " + item.p.X + " " + item.p.Y + " " + item.direction + " " + index);
                }
            }
        }
        private void MinutaesDetection(object sender, RoutedEventArgs e)
        {
            QUATRE.Source = ImageSupporter.Bitmap2BitmapImage(fingerprint.getSectionPoints((Bitmap)workingImage.Clone()));

            Tuple <Bitmap, Bitmap> alreadyPassedImages = fingerprint.getAlreadyPassed();

            pojedynczyKierunek.Source    = ImageSupporter.Bitmap2BitmapImage(alreadyPassedImages.Item2);
            threetothreeImage.Source     = ImageSupporter.Bitmap2BitmapImage(alreadyPassedImages.Item1);
            temporaryMinutiasMap         = new MinutiaWektor(fingerprint.GetTemporaryMinutiasMap());
            MinuteaWektorInformator.Text = "Wykryto " + temporaryMinutiasMap.m.Count() + " minucji \n" +
                                           +temporaryMinutiasMap.GetEndCount() + " zakończeń \n" +
                                           +temporaryMinutiasMap.GetForkCount() + " rozwidleń";
        }
        private void ShowChosenFingerprint(object sender, RoutedEventArgs e)
        {
            int index = DatabaseList.Items.IndexOf(sender);

            chossenDatabaseElement = index;
            DatabaseElement chosen = databaseList[index];

            Bitmap b = ImageSupporter.BitmapImage2Bitmap(new BitmapImage(new Uri(Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName + "\\database\\" + chosen.FingerprntName + ".png")));

            MinutiaWektor zbazy = database.mBase[index].MinutiaesWektor;

            b             = MatchMinuties2(b, zbazy, Color.Blue, Color.Orange);
            QUATRE.Source = ImageSupporter.Bitmap2BitmapImage(b);
        }
コード例 #9
0
        private int HowManyIdenticalMinuties(MinutiaWektor databaseMinutia, MinutiaWektor n)// działa poprawnie sprawdzone
        {
            //tutaj można jeszcze zaprogramować zaznaczanie miucji jako dopasowanych
            int number = 0;//liczna identycznych minucji

            foreach (var dm in databaseMinutia.m)
            {
                foreach (var nm in n.m)
                {
                    if (mm(dm, nm))
                    {
                        number++;
                        //     break;
                    }
                }
            }
            return(number);
        }
        private Bitmap MatchMinuties2(Bitmap bitmap, MinutiaWektor wektor, Color zakocznczenia, Color rozwidlenia)
        {
            Bitmap final = (Bitmap)bitmap.Clone();

            foreach (var p in wektor.m)
            {
                for (int i = p.p.X - 1; i < p.p.X + 1; i++)
                {
                    for (int j = p.p.Y - 1; j < p.p.Y + 1; j++)
                    {
                        if (i < final.Width && i > 0 && j < final.Height && j > 0)
                        {
                            ImageSupporter.MatchMinutia2(final, zakocznczenia, rozwidlenia, p);
                        }
                    }
                }
            }
            return(final);
        }
        private void ListBox_DoubleClick(object sender, RoutedEventArgs e)
        {
            int                 index        = EqualFingerprintList.Items.IndexOf(sender);
            DatabaseElement     chosen       = equals[index].Item1;
            ModyficationElement przesuniecie = equals[index].Item3;
            MinutiaWektor       wektor       = temporaryMinutiasMap;

            MinutiaWektor przesunietyWektor = new MinutiaWektorComperer().MapMinutiaWektor(temporaryMinutiasMap, przesuniecie);

            Bitmap b = ImageSupporter.BitmapImage2Bitmap(new BitmapImage(new Uri(Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName + "\\database\\" + chosen.FingerprntName + ".png")));

            b = MatchMinuties2(b, przesunietyWektor, Color.Green, Color.Green);
            MinutiaWektor zbazy = database.mBase[index].MinutiaesWektor;

            b = MatchMinuties2(b, zbazy, Color.Blue, Color.Blue);
            b = MatchMinuties2(b, temporaryMinutiasMap, Color.Orange, Color.Orange);

            QUATRE.Source = ImageSupporter.Bitmap2BitmapImage(b);
        }
コード例 #12
0
 private Tuple <bool, float> Voting(MinutiaWektor froDatabase, MinutiaWektor scaned)
 {
     foreach (var d in froDatabase.m) //wekrot minucji z bazy danych
     {
         foreach (var n in scaned.m)  //wektor minucji analizowanego odcisku
         {
             for (int angle = angleRangeBottom; angle < angleRangeTop; angle += angleJump)
             {
                 // if(dd(ImageSupporter.DegreeToRadian( angle),0)<ImageSupporter.DegreeToRadian(3) && d.p.Equals(n.p))
                 if (dd(n.direction + ImageSupporter.DegreeToRadian(angle), d.direction) < LimitRotate)
                 {
                     Point tmp = getShift(n, d, ImageSupporter.DegreeToRadian(angle));
                     ModyficationElement vote = new ModyficationElement(tmp.X, tmp.Y, angle);
                     Vote(vote);
                 }
             }
         }
     }
     return(new Tuple <bool, float>(false, 0));
 }
コード例 #13
0
        private int GetAngle(MinutiaWektor froDatabase, MinutiaWektor scaned)
        {
            int[] ballotDodatni = new int[45];
            int[] ballotUjemny  = new int[45];
            foreach (var d in froDatabase.m) //wektor minucji z bazy danych
            {
                foreach (var n in scaned.m)  //wektor minucji analizowanego odcisku
                {
                    // for (int angle = angleRangeBottom; angle < angleRangeTop; angle += angleJump)
                    //{
                    //if (dd(n.direction + ImageSupporter.DegreeToRadian(angle), d.direction) < LimitRotate)
                    //{
                    //double katPrzesuniecia = dd(n.direction, d.direction);
                    int katPrzesuniecia = (int)(ImageSupporter.RadianToDegree(ddd(n.direction, d.direction)) + 0.5);
                    if (katPrzesuniecia > 0)
                    {
                        if (katPrzesuniecia < 45)
                        {
                            ballotDodatni[katPrzesuniecia]++;
                        }
                    }
                    else
                    {
                        if (Math.Abs(katPrzesuniecia) < 45)
                        {
                            ballotUjemny[katPrzesuniecia]++;
                        }
                    }


                    //int index=(angle - angleRangeBottom) / angleJump;
                    //ballot[index] += 1;
                    //}
                    //}
                }
            }

            int maxDodatni  = 0;
            int katDodatnik = 0;

            for (int i = 0; i < ballotDodatni.Length; i++)
            {
                if (maxDodatni < ballotDodatni[i])
                {
                }
            }

            for (int i = 0; i < ballotUjemny.Length; i++)
            {
            }


            /*  int j = 0;
             * int ang = 0;
             * for(int i=0;i<ballot.Length;i++)
             * {
             *    if(ballot[i]>ang)
             *    {
             *        i = j;
             *        ang = ballot[i];
             *
             *    }
             * }*/

            //return angleRangeBottom + j * angleJump;
            return(0);
        }
コード例 #14
0
        public List <Tuple <DatabaseElement, int, ModyficationElement, int> > CheckWithDatabase(MinutiaWektor potential)
        {
            List <Tuple <DatabaseElement, int, ModyficationElement, int> > result;

            //potential = mBase[0].MinutiaesWektor;
            result = CheckList(potential);
            return(result);
        }
 private void MinutaesDetection()
 {
     QUATRE.Source        = ImageSupporter.Bitmap2BitmapImage(fingerprint.getSectionPoints((Bitmap)workingImage.Clone()));
     temporaryMinutiasMap = new MinutiaWektor(fingerprint.GetTemporaryMinutiasMap());
 }
コード例 #16
0
        }                                                //wektor cech obrazu linii papilarnej

        public DatabaseElement(string fingetrprontName, MinutiaWektor minuteasList)
        {
            this.FingerprntName  = fingetrprontName;
            this.MinutiaesWektor = minuteasList;
        }
コード例 #17
0
        public List <Tuple <DatabaseElement, int, ModyficationElement, int> > CheckList(MinutiaWektor wektor)
        {
            List <Tuple <DatabaseElement, int, ModyficationElement, int> > result = new List <Tuple <DatabaseElement, int, ModyficationElement, int> >();
            MinutiaWektorComperer comperer = new MinutiaWektorComperer(10, 10, ImageSupporter.DegreeToRadian(15));

            foreach (var item in mBase)
            {
                Tuple <bool, int, ModyficationElement, int> compereResult = comperer.Compere(item.MinutiaesWektor, wektor);

                if (compereResult.Item1)
                {
                    result.Add(new Tuple <DatabaseElement, int, ModyficationElement, int>(item, compereResult.Item2, compereResult.Item3, compereResult.Item4));
                }
            }



            return(result);
        }
コード例 #18
0
 public void Add(MinutiaWektor wektor, string imageName)
 {
     this.mBase.Add(new DatabaseElement(imageName, wektor));
     Save();
 }