コード例 #1
0
        public static VerificationResults.BasicResult DoVerification(IVerificationSystem verifier, GestureDataSet trainingSet, GestureDataSet genuineSet, GestureDataSet forgerySet)
        {
            Stopwatch swTrain = new Stopwatch();

            //train recognition system
            verifier.clearGestures();
            swTrain.Restart();
            foreach (var e in trainingSet)
            {
                verifier.trainGesture(e.Key, e.Value);
            }
            swTrain.Stop();

            int nFalseAccepts = 0;
            int nFalseRejects = 0;

            int nGenuineAttempts = 0;

            //test genuine
            foreach (var e in genuineSet)
            {
                foreach (var trace in e.Value)
                {
                    var userVerified = verifier.verifyGesture(e.Key, trace);
                    if (!userVerified)
                    {
                        nFalseRejects++;
                    }
                    nGenuineAttempts++;
                }
            }

            int nForgeryAttempts = 0;

            //test forgeries
            foreach (var e in forgerySet)
            {
                foreach (var trace in e.Value)
                {
                    var userVerified = verifier.verifyGesture(e.Key, trace);
                    if (userVerified)
                    {
                        nFalseAccepts++;
                    }
                    nForgeryAttempts++;
                }
            }

            double FAR = (double)nFalseAccepts / nForgeryAttempts;
            double FRR = (double)nFalseRejects / nGenuineAttempts;

            return(new VerificationResults.BasicResult(FAR, FRR));
        }
コード例 #2
0
        public VerificationExperiment(IVerificationSystem verifier /*, IVerificationSubsetCreator subsetCreator, ITraceDataProcessor traceProcessor*/, string setName)
        {
            gestureSetName = setName;
            this.verifier  = verifier;
            //this.subsetCreator = subsetCreator;
            //this.traceProcessor = traceProcessor;

            var allSets = DataSets.getVerificationDataSet(gestureSetName);

            trainingSet = allSets.First();
            genuineSet  = allSets.Skip(1).First();
            forgerySet  = allSets.Skip(2).First();
        }