Пример #1
0
 private static object GetTemplate(string fileName)
 {
     //if this template exist alredy
     if (File.Exists(Constants.pathToTemplatesDb + fileName + "_t"))
     {
         return(MccSdk.LoadMccTemplateFromTextFile(Constants.pathToTemplatesDb + fileName + "_t"));
     }
     else
     {
         var    image    = ImageHelper.LoadImage(Constants.PathToDb + fileName);
         var    minutiae = MinutiaeExtractor.GetBiolabMinutiae(image);
         object template = MccSdk.CreateMccTemplate(image.GetLength(1), image.GetLength(0), 500, minutiae.ToArray());
         MccSdk.SaveMccTemplateToTextFile(template, Constants.pathToTemplatesDb + fileName + "_t");
         return(template);
     }
 }
Пример #2
0
        private static object LoadCylinderTemplateFromFile(string filePath)
        {
            object template = null;

            switch (Path.GetExtension(filePath).ToLowerInvariant())
            {
            case ".mcc":
                template = MccSdk.LoadMccTemplateFromBinaryFile(filePath);
                break;

            case ".txt":
                template = MccSdk.LoadMccTemplateFromTextFile(filePath);
                break;

            default:
                throw new Exception("Template file format not supported");
            }

            return(template);
        }