예제 #1
0
 protected virtual void OnSemafoorDetected(IUserChangedEvent userEvent, Semaphore semafoor)
 {
     EventHandler<KinectSemaphoreGestureEventArgs> handler = SemafoorDetected;
     if (handler != null)
     {
         handler(this, new KinectSemaphoreGestureEventArgs(userEvent, semafoor));
     }
 }
예제 #2
0
 protected virtual void OnDoubleClap(IUserChangedEvent userEvent)
 {
     EventHandler<KinectGestureEventArgs> handler = DoubleClap;
     if (handler != null)
     {
         handler(this, new KinectGestureEventArgs(userEvent));
     }
 }
예제 #3
0
 public override void Process(IUserChangedEvent evt)
 {
     _selfTouchCount++;
     if (_selfTouchCount > HistoryCount)
     {
         OnSelfTouchDetected(evt.Id, Joints);
         _selfTouchCount = 0;
     }
 }
예제 #4
0
 public override void Process(IUserChangedEvent evt)
 {
     _selfTouchCount++;
     if (_selfTouchCount > HistoryCount)
     {
         OnSelfTouchDetected(evt.Id, Joints);
         _selfTouchCount = 0;
     }
 }
        protected virtual void OnSemafoorDetected(IUserChangedEvent userEvent, Semaphore semafoor)
        {
            EventHandler <KinectSemaphoreGestureEventArgs> handler = SemafoorDetected;

            if (handler != null)
            {
                handler(this, new KinectSemaphoreGestureEventArgs(userEvent, semafoor));
            }
        }
예제 #6
0
        protected virtual void OnDoubleClap(IUserChangedEvent userEvent)
        {
            EventHandler <KinectGestureEventArgs> handler = DoubleClap;

            if (handler != null)
            {
                handler(this, new KinectGestureEventArgs(userEvent));
            }
        }
예제 #7
0
        private void OnUserRemoved(IUserChangedEvent userEvent)
        {
            var handler = UserRemoved;

            if (handler == null)
            {
                return;
            }
            handler(this, new KinectUserEventArgs(userEvent));
        }
        public override void Process(IUserChangedEvent evt)
        {
            AddPoints(evt.HandLeft, evt.ShoulderLeft, evt.HandRight, evt.ShoulderRight);
            Semaphore detectedSemaphore = CheckForSemafoor();

            if (detectedSemaphore != null)
            {
                OnSemafoorDetected(evt, detectedSemaphore);
            }
        }
예제 #9
0
        public override void Process(IUserChangedEvent evt)
        {
            AddPoints(evt.HandLeft, evt.ShoulderLeft, evt.HandRight, evt.ShoulderRight);
            Semaphore detectedSemaphore = CheckForSemafoor();

            if (detectedSemaphore != null)
            {
                OnSemafoorDetected(evt, detectedSemaphore);
            }
        }
예제 #10
0
        public static List <Point3D> GetPoints(this IUserChangedEvent evt, params JointID[] joints)
        {
            var points = new List <Point3D>();

            foreach (JointID joint in joints)
            {
                points.Add(GetPoint(evt, joint));
            }

            return(points);
        }
예제 #11
0
        /// <summary>
        /// Processes the specified evt.
        /// </summary>
        /// <param name="evt">The evt.</param>
        public override void Process(IUserChangedEvent evt)
        {
            OnProcessingEvent(evt);
            var handsAreTogether = false;

            //TODO: Check if hands are together

            if (handsAreTogether)
            {
                OnGestureDetected();
            }

            OnProcessedEvent(evt);
        }
예제 #12
0
        /// <summary>
        /// Processes the specified evt.
        /// </summary>
        /// <param name="evt">The evt.</param>
        public override void Process(IUserChangedEvent evt)
        {
            OnProcessingEvent(evt);
            var handsAreTogether = false;

            //TODO: Check if hands are together

            if (handsAreTogether)
            {
                OnGestureDetected();
            }

            OnProcessedEvent(evt);
        }
        /// <summary>
        /// Processes the specified evt.
        /// </summary>
        /// <param name="evt">The evt.</param>
        public override void Process(IUserChangedEvent evt)
        {
            if (evt != null)
            {
                double predictedarmlength = evt.ShoulderRight.Y - evt.HipRight.Y -
                                            ((evt.HipRight.Y - evt.KneeRight.Y) / 2);
                double maxposition    = evt.ShoulderRight.Y + predictedarmlength;
                double minposition    = evt.ShoulderRight.Y - predictedarmlength;
                double position       = evt.HandRight.Y - evt.ShoulderRight.Y;
                double ratio          = (maxposition - minposition) / 2;
                double normalPosition = position / ratio;

                //double predictedarmlength = evt.RightHip.Y - evt.RightShoulder.Y - ((evt.RightKnee.Y - evt.RightHip.Y) / 2);
                //double maxposition = evt.RightShoulder.Y - predictedarmlength;
                //double minposition = evt.RightShoulder.Y + predictedarmlength;
                //double position = evt.RightHand.Y + evt.RightShoulder.Y;
                //double ratio = (maxposition + minposition) / 2;
                //double normalPosition = position / ratio;

                OnAccelerationCalculated(evt.Id, -normalPosition);
            }
        }
예제 #14
0
 public override void Process(IUserChangedEvent evt)
 {
     ////TODO: Gesture <logica hier aanroepen en andere methodes private maken>
     ////OnSingleClap(evt);
     ////OnDoubleClap(evt);
 }
 public KinectGestureEventArgs(IUserChangedEvent user)
     : base(user)
 {
 }
예제 #16
0
 private void OnUserRemoved(IUserChangedEvent userEvent)
 {
     var handler = UserRemoved;
     if (handler == null) return;
     handler(this, new KinectUserEventArgs(userEvent));
 }
예제 #17
0
 public override void Process(IUserChangedEvent evt)
 {
     throw new NotImplementedException();
 }
예제 #18
0
 public KinectSemaphoreGestureEventArgs(IUserChangedEvent userEvent, Semaphore semafoor)
     : base(userEvent)
 {
     Semafoor = semafoor;
 }
예제 #19
0
 public override void Process(IUserChangedEvent evt)
 {
     throw new NotImplementedException();
 }
예제 #20
0
        public static Point3D GetPoint(this IUserChangedEvent evt, JointID joint)
        {
            switch (joint)
            {
            case JointID.Head:
                return(evt.Head);

            case JointID.AnkleLeft:
                return(evt.AnkleLeft);

            case JointID.ElbowLeft:
                return(evt.ElbowLeft);

            case JointID.FootLeft:
                return(evt.FootLeft);

            case JointID.HandLeft:
                return(evt.HandLeft);

            case JointID.KneeLeft:
                return(evt.KneeLeft);

            case JointID.ShoulderLeft:
                return(evt.ShoulderLeft);

            case JointID.HipLeft:
                return(evt.HipLeft);

            case JointID.ShoulderCenter:
                return(evt.ShoulderCenter);

            case JointID.AnkleRight:
                return(evt.AnkleRight);

            case JointID.ElbowRight:
                return(evt.ElbowRight);

            case JointID.FootRight:
                return(evt.FootRight);

            case JointID.HandRight:
                return(evt.HandRight);

            case JointID.KneeRight:
                return(evt.KneeRight);

            case JointID.HipRight:
                return(evt.HipRight);

            case JointID.ShoulderRight:
                return(evt.ShoulderRight);

            case JointID.Spine:
                return(evt.Spine);

            case JointID.HipCenter:
                return(evt.HipCenter);
            }

            return(default(Point3D));
        }
예제 #21
0
 public KinectUserEventArgs(IUserChangedEvent user)
 {
     User = user;
 }
예제 #22
0
 public KinectUserEventArgs(IUserChangedEvent user)
 {
     User = user;
 }
예제 #23
0
 public override void Process(IUserChangedEvent evt)
 {
     ////TODO: Gesture <logica hier aanroepen en andere methodes private maken>
     ////OnSingleClap(evt);
     ////OnDoubleClap(evt);
 }
 public KinectSemaphoreGestureEventArgs(IUserChangedEvent userEvent, Semaphore semafoor)
     : base(userEvent)
 {
     Semafoor = semafoor;
 }