Exemplo n.º 1
0
        private void matchWithDbToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bool                   isMatched         = false;
            List <Minutiae>        originalMinutiaes = GetMinutiaesFromBitmap(originalBitmap);
            DbJSONSerializer       db              = new DbJSONSerializer();
            Fingerprints           fingerprints    = db.DeserializeMinutiaes(db.ReadFromJsonFile("db_fingerprints.json"));
            List <UserFingerprint> userFingerPrint = fingerprints.userFingerprints;

            foreach (UserFingerprint uf in userFingerPrint)
            {
                Debug.Print("Porównuje " + uf.name);
                MatchingFingerprints.SetAccumulatorDimension(originalBitmap.Width, originalBitmap.Height);
                TranslationVotes votes = MatchingFingerprints.Matching(originalMinutiaes, uf.minutiaes);
                if (MatchingFingerprints.IsIdentical(originalMinutiaes, uf.minutiaes, votes))
                {
                    isMatched = true;
                    MessageBox.Show(uf.name);
                    break;
                }
            }
            if (!isMatched)
            {
                MessageBox.Show("Brak usera w bazie");
            }
        }
Exemplo n.º 2
0
        public MatcherWithDb(List <Minutiae> originalMinutiaes, string dbFileName)
        {
            DbJSONSerializer serializer = new DbJSONSerializer();

            fingerprints = serializer.DeserializeMinutiaes(serializer.ReadFromJsonFile("db_fingerprints.json"));
            List <UserFingerprint> userFingerprints = fingerprints.userFingerprints;

            foreach (UserFingerprint fp in userFingerprints)
            {
                if (CompareFingerprints(originalMinutiaes, fp.minutiaes))
                {
                    Console.WriteLine("Znaleziono odcisk w bazie");
                    break;
                }
            }
        }