コード例 #1
0
        public Database <StandardRecord <StandardRecordData> > createDatabase()
        {
            Database <StandardRecord <StandardRecordData> > database = new Database <StandardRecord <StandardRecordData> >();

            DirectoryInfo di   = new DirectoryInfo(this.databasePath);
            string        path = Directory.GetCurrentDirectory();

            Console.WriteLine("Curr dir:  {0}", path);

            // TODO: Vlozit spravnou priponu!!!!
            //FileInfo[] files = di.GetFiles("*.tiff");
            FileInfo[] files = di.GetFiles("*.png");

            foreach (FileInfo f in files)
            {
                string[] parts = f.Name.Split(new char[] { '.' }, StringSplitOptions.RemoveEmptyEntries);

                BiometricID        bioID = new BiometricID(parts[0], "fingerPrint");
                StandardRecordData data  = new StandardRecordData(f.FullName);
                StandardRecord <StandardRecordData> record = new StandardRecord <StandardRecordData>(f.Name, bioID, data);

                database.addRecord(record);
            }
            return(database);
        }
コード例 #2
0
        public Database <StandardRecord <StandardRecordData> > createDatabase()
        {
            var database = new Database <StandardRecord <StandardRecordData> >();

            var di = new DirectoryInfo(_databasePath);

            var index_file = _databasePath + @"\index.txt";

            if (!File.Exists(index_file))
            {
                throw new Exception("Database index file doesn't exist");
            }

            var files = di.GetFiles("*.pgm");

            foreach (var f in files)
            {
                Console.WriteLine(f);
                var parts = f.Name.Split(new[] { '.' }, StringSplitOptions.RemoveEmptyEntries);

                string id = parts[0];
                using (StreamReader sr = File.OpenText(index_file))
                {
                    string s = "";
                    while ((s = sr.ReadLine()) != null)
                    {
                        if (s.Contains(parts[0]))
                        {
                            id = s.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)[0];
                            break;
                        }
                    }
                }

                //Console.WriteLine(f + ": " + id);

                var bioID  = new BiometricID(id, "Retina");
                var data   = new StandardRecordData(f.FullName);
                var record = new StandardRecord <StandardRecordData>(f.Name, bioID, data);

                database.addRecord(record);
            }

            return(database);
        }
コード例 #3
0
        public Framework.Core.Database.Database <StandardRecord <StandardRecordData> > createDatabase()
        {
            Framework.Core.Database.Database <StandardRecord <StandardRecordData> > database = new Framework.Core.Database.Database <StandardRecord <StandardRecordData> >();

            DirectoryInfo di = new DirectoryInfo(this.databasePath);

            FileInfo[] files = di.GetFiles("*.tiff");
            foreach (FileInfo f in files)
            {
                string [] parts = f.Name.Split(new char [] { '.' }, StringSplitOptions.RemoveEmptyEntries);

                BiometricID        bioID = new BiometricID(parts[0], "face");
                StandardRecordData data  = new StandardRecordData(f.FullName);
                StandardRecord <StandardRecordData> record = new StandardRecord <StandardRecordData>(f.Name, bioID, data);

                database.addRecord(record);
            }
            return(database);
        }
コード例 #4
0
        public Database <StandardRecord <StandardRecordData> > createDatabase()
        {
            Database <StandardRecord <StandardRecordData> > database = new Database <StandardRecord <StandardRecordData> >();
            DirectoryInfo di = new DirectoryInfo(this.pathToDatabase);

            FileInfo[] files = di.GetFiles("*.png", SearchOption.AllDirectories);

            foreach (FileInfo file in files)
            {
                string[]           parts                   = file.Name.Split(new char[] { '_' }, StringSplitOptions.RemoveEmptyEntries);
                BiometricID        biometricID             = new BiometricID(parts[0], "fingerprint");
                StandardRecordData recordData              = new StandardRecordData(file.FullName);
                StandardRecord <StandardRecordData> record = new StandardRecord <StandardRecordData>(file.Name, biometricID, recordData);

                database.addRecord(record);
            }

            return(database);
        }
コード例 #5
0
        public Database <StandardRecord <StandardRecordData> > createDatabase()
        {
            var database = new Database <StandardRecord <StandardRecordData> >();

            var di    = new DirectoryInfo(_databasePath);
            var files = di.GetFiles("*-small-range.png");

            foreach (var f in files)
            {
                var parts = f.Name.Split(new[] { '-' }, StringSplitOptions.RemoveEmptyEntries);

                var bioID  = new BiometricID(parts[0], "3d_face_range_image");
                var data   = new StandardRecordData(f.FullName);
                var record = new StandardRecord <StandardRecordData>(f.Name, bioID, data);

                database.addRecord(record);
            }

            return(database);
        }
コード例 #6
0
ファイル: TemplateRecord.cs プロジェクト: harpener/BIO
 public TemplateRecord(string sampleID, BiometricID bioID, Template.Persistence.IPersistentTemplate template)
 {
     this.PersistentTemplate = template;
     this.BiometricID = bioID;
     this.SampleID = sampleID;
 }
コード例 #7
0
ファイル: Record.cs プロジェクト: harpener/BIO
 /*
 public Record(BiometricID bioID) {
     BiometricID = bioID;
     UniqueRecordID = "";
 }*/
 public Record(BiometricID bioID, string sampleID)
 {
     BiometricID = bioID;
     SampleID = sampleID;
 }
コード例 #8
0
 public TemplateRecord(string sampleID, BiometricID bioID, Template.Persistence.IPersistentTemplate template)
 {
     this.PersistentTemplate = template;
     this.BiometricID        = bioID;
     this.SampleID           = sampleID;
 }