using KinectUtils;
using Microsoft.Kinect;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace MyGestureBank
{
///
/// The two hands up posture.
///
public class PostureTwoHandsUp : Posture
{
public PostureTwoHandsUp()
{
GestureName = "Two Hands Up";
}
///
/// The test gesture method.
///
/// The body
public override void TestGesture(Body body)
{
if (TestPosture(body))
{
Console.WriteLine("Gesture recognized, two hands up");
Thread.Sleep(1000);
OnGestureRecognized();
}
}
///
/// The test posture method.
///
///
///
///
protected override bool TestPosture(Body body)
{
// Check if two hands are up
return body.Joints[JointType.HandRight].Position.Y > body.Joints[JointType.ShoulderRight].Position.Y &&
body.Joints[JointType.HandLeft].Position.Y > body.Joints[JointType.ShoulderLeft].Position.Y;
}
}
}