예제 #1
0
        public string recognizeGesture(BaseTrajectory trace)
        {
            var t = new Template(trace.TrajectoryPoints);
            //var best = knownTrajectories.MinBy(kt => kt.getBestCost(t, withTime));

            double          minCost = double.MaxValue;
            TrajectoryModel best    = null;

            foreach (var kt in knownTrajectories)
            {
                var cost = kt.getBestCost(t, withTime);
                if (cost < minCost)
                {
                    minCost = cost;
                    best    = kt;
                }
            }

            return(best.Name);
        }
예제 #2
0
        public void trainGesture(string gestureName, IEnumerable <BaseTrajectory> trainingTraces)
        {
            var trajectoryModel = new TrajectoryModel(gestureName, trainingTraces.Select(t => t.TrajectoryPoints));

            knownTrajectories.AddLast(trajectoryModel);
        }