Ejemplo n.º 1
0
        //here, we create a myomi gesture profile from the data and options given
        private MyomiGesture AnalyzeData(List <MyoData> data, MyomiGestureOptions options)
        {
            //the idea is that we are comparing it frame by frame
            var profileFrames = new List <MyoDataProfile>();
            //we want to isolate the first frame for comparison, the prev frame will be the first unique frame listed
            var prevFrame = data.First();

            profileFrames.Add(MyoDataProfile.ConvertToProfile(prevFrame));
            data.RemoveAt(0);
            //this is just original data profiling, later, we need to create a new profile based on the options
            foreach (var dataFrame in data)
            {
                //returning 1 would mean they are the same
                if (prevFrame.CompareTo(dataFrame) == 1)
                {
                    profileFrames.Last().Frames++;
                }
                else
                {
                    //they are different, so we have a new frame set, we want this as the unique frame now
                    profileFrames.Add(MyoDataProfile.ConvertToProfile(dataFrame));
                    prevFrame = dataFrame;
                }
            }
            return(new MyomiGesture(options, profileFrames));
        }
Ejemplo n.º 2
0
        public int Evaluator(MyoDataProfile toCompare, MyomiGestureOptions options, int initialScore)
        {
            //initial score should be 100 unless there's frame mismatches
            int score = initialScore;

            score -= _poseAnalyzer.GetPoint(toCompare.Pose, options);
            score -= _accelAnalyzer.GetPoint(toCompare.Accel, options);
            score -= _gyroAnalyzer.GetPoint(toCompare.Gyro, options);
            score -= _orienAnalyzer.GetPoint(toCompare.Orien, options);
            return(score);
        }