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.
55 lines
1.6 KiB
55 lines
1.6 KiB
using Lib;
|
|
using LibMyGesturesBank;
|
|
using Microsoft.Kinect;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ConsoleApp
|
|
{
|
|
internal class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
KinectManager kinectManager = new KinectManager();
|
|
if (!kinectManager.StartSensor())
|
|
{
|
|
Console.WriteLine("Kinect n'est pas connecté ou non reconnu.");
|
|
return;
|
|
}
|
|
|
|
// Créez les instances de vos postures
|
|
PostureHandUp handUpPosture = new PostureHandUp();
|
|
PostureHandsOnHead handsOnHeadPosture = new PostureHandsOnHead();
|
|
|
|
// Abonnez-vous aux événements de reconnaissance de posture
|
|
handUpPosture.GestureRecognized += (sender, e) =>
|
|
{
|
|
Console.WriteLine("Posture Hand Up reconnue !");
|
|
};
|
|
|
|
handsOnHeadPosture.GestureRecognized += (sender, e) =>
|
|
{
|
|
Console.WriteLine("Posture Hands On Head reconnue !");
|
|
};
|
|
|
|
// Boucle pour tester les postures
|
|
while (true)
|
|
{
|
|
Body body = kinectManager.GetNextBody(); // Méthode fictive pour obtenir les données du corps
|
|
if (body != null)
|
|
{
|
|
handUpPosture.TestGesture(body);
|
|
handsOnHeadPosture.TestGesture(body);
|
|
}
|
|
|
|
Thread.Sleep(50); // Une petite pause pour ne pas surcharger le CPU
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|