Exemplo n.º 1
0
        public static double GetIdentity(string fileName1, string fileName2)
        {
            object template1 = GetTemplate(fileName1);
            object template2 = GetTemplate(fileName2);

            MccSdk.SetMccMatchParameters(Constants.pathToMccParams);
            double answer = BioLab.Biometrics.Mcc.Sdk.MccSdk.MatchMccTemplates(template1, template2);

            return(answer);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            if (args.Length != 4 &&
                args.Length != 5)
            {
                Console.WriteLine("\nSyntax error.\nUse: MccMatcher <MccTemplateFile1> <MccTemplateFile2> <MccMatchParametersFile> <OutputFile> [MccEnrollParametersFile]\n");
                Console.WriteLine("[MccEnrollParametersFile] is only needed to load MccTemplateFiles stored in text format.\n");
                return;
            }
            var mccTemplateFile1   = args[0];
            var mccTemplateFile2   = args[1];
            var mccMatchParamFile  = args[2];
            var outputFile         = args[3];
            var mccEnrollParamFile = args.Length == 5 ? args[4] : null;

            var matchPerformed = true;
            var score          = -1.0;

            try
            {
                if (mccEnrollParamFile != null)
                {
                    MccSdk.SetMccEnrollParameters(mccEnrollParamFile);
                }

                MccSdk.SetMccMatchParameters(mccMatchParamFile);

                /*var template1 = LoadCylinderTemplateFromFile(mccTemplateFile1);
                *  var template2 = LoadCylinderTemplateFromFile(mccTemplateFile2);*/

                var template1 = MccSdk.CreateMccTemplateFromTextTemplate(mccTemplateFile1);
                var template2 = MccSdk.CreateMccTemplateFromTextTemplate(mccTemplateFile2);
                //MccSdk.SaveMccTemplateToTextFile(template1, "D:\\Users\\Malik\\Desktop\\STAGE GREYC\\SDKs\\results\\t1.txt");
                //MccSdk.SaveMccTemplateToTextFile(template2, "D:\\Users\\Malik\\Desktop\\STAGE GREYC\\SDKs\\results\\t2.txt");

                score = MccSdk.MatchMccTemplates(template1, template2);
            }
            catch (Exception e)
            {
                matchPerformed = false;
                Console.WriteLine(e);
            }

            File.AppendAllText(outputFile, string.Format(CultureInfo.InvariantCulture,
                                                         "{0} {1} {2} {3:R}\r\n",
                                                         mccTemplateFile1,
                                                         mccTemplateFile2,
                                                         matchPerformed ? "OK" : "FAIL",
                                                         score));
        }