I want Triangle Gesture Detect!

Oct 30, 2014 at 11:57 AM
Edited Oct 30, 2014 at 12:02 PM
Hi! .. I'm Korean student..

I have a question..! I following the circle gesture and created "triangle gesture" !

triKB.save file and detection!

but, DETECTED GESTURES in message is Circle gesture and Triangle Gesture same time view.

such as, Circle gesture detect -> Circle blah blah... same time!
                                            Triangle blah blah..      same time!
What happens? help me please!
    SwipeGestureDetector swipeGestureRecognizer;
    TemplatedGestureDetector circleGestureRecognizer;
    TemplatedGestureDetector triGestureRecognizer;
.....
    string circleKBPath;
    string letterT_KBPath;
    string triKBPath;


   private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        circleKBPath = Path.Combine(Environment.CurrentDirectory, @"data\circleKB.save");
        letterT_KBPath = Path.Combine(Environment.CurrentDirectory, @"data\t_KB.save");
        triKBPath = Path.Combine(Environment.CurrentDirectory, @"data\triKB.save");
....
  }

private void Initialize()
    {
         .....
        LoadCircleGestureDetector();
        LoadTriGestureDetector();
        LoadLetterTPostureDetector();

        .....

       parallelCombinedGestureDetector = new ParallelCombinedGestureDetector();
        parallelCombinedGestureDetector.OnGestureDetected += OnGestureDetected;
        parallelCombinedGestureDetector.Add(swipeGestureRecognizer);
        parallelCombinedGestureDetector.Add(circleGestureRecognizer);
        parallelCombinedGestureDetector.Add(triGestureRecognizer);

   }

    void ProcessFrame(ReplaySkeletonFrame frame)
    {

           ...
                       if (joint.JointType == JointType.HandRight)
                {

                        circleGestureRecognizer.Add(joint.Position, kinectSensor);
                         triGestureRecognizer.Add(joint.Position, kinectSensor);


                }
                else if (joint.JointType == JointType.HandLeft)
                {
                    swipeGestureRecognizer.Add(joint.Position, kinectSensor);
                    if (controlMouse.IsChecked == true)
                        MouseController.Current.SetHandPosition(kinectSensor, joint, skeleton);
                }

               ...


  private void Clean()
    {
.....
        if (parallelCombinedGestureDetector != null)
        {
            parallelCombinedGestureDetector.Remove(swipeGestureRecognizer);
            parallelCombinedGestureDetector.Remove(circleGestureRecognizer);
            parallelCombinedGestureDetector.Remove(triGestureRecognizer);
            //----------------------------- Added Triangle
            parallelCombinedGestureDetector = null;
        }


 }


void LoadCircleGestureDetector()
    {
        using (Stream recordStream = File.Open(circleKBPath, FileMode.OpenOrCreate))
        {
            circleGestureRecognizer = new TemplatedGestureDetector("Circle", recordStream);
            circleGestureRecognizer.DisplayCanvas = gesturesCanvas;
            circleGestureRecognizer.OnGestureDetected += OnGestureDetected;
            //제스쳐를 인식시킬 수 있도록, 제스쳐 리스트에 추가시킴

            MouseController.Current.ClickGestureDetector = circleGestureRecognizer;

        }
    }

    void LoadTriGestureDetector()
    {
        using (Stream recordStream = File.Open(triKBPath, FileMode.OpenOrCreate))
        {
            triGestureRecognizer = new TemplatedGestureDetector("Triangle", recordStream);
           triGestureRecognizer.DisplayCanvas = gesturesCanvas;
            triGestureRecognizer.OnGestureDetected += OnGestureDetected;

            //MouseController.Current.ClickGestureDetector = triGestureRecognizer;

        }
    }


and so on.... Please, Help me