You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
688 B

using Microsoft.Kinect;
using System;
using KinectUtils;
namespace MyGesturesBank
{
public class PostureHandsOnHead : Posture
{
protected override bool TestPosture(Body body)
{
var handRight = body.Joints[JointType.HandRight].Position;
var handLeft = body.Joints[JointType.HandLeft].Position;
var head = body.Joints[JointType.Head].Position;
// Ajustez les seuils selon la précision souhaitée
var threshold = 0.1f; // Seuil pour ajuster la précision de la détection
return Math.Abs(handRight.Y - head.Y) < threshold && Math.Abs(handLeft.Y - head.Y) < threshold;
}
}
}