diff --git a/KinectSensorStreams.sln b/KinectSensorStreams.sln index ff8c597..0c0398e 100644 --- a/KinectSensorStreams.sln +++ b/KinectSensorStreams.sln @@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KinectUtils", "KinectUtils\ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyGestureBank", "MyGestureBank\MyGestureBank.csproj", "{D70B7357-6FF8-4F35-A283-8DB4217C0C85}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostureTester", "PostureTester\PostureTester.csproj", "{7C427E13-E012-4C29-97ED-1792BA40F063}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -33,6 +35,10 @@ Global {D70B7357-6FF8-4F35-A283-8DB4217C0C85}.Debug|Any CPU.Build.0 = Debug|Any CPU {D70B7357-6FF8-4F35-A283-8DB4217C0C85}.Release|Any CPU.ActiveCfg = Release|Any CPU {D70B7357-6FF8-4F35-A283-8DB4217C0C85}.Release|Any CPU.Build.0 = Release|Any CPU + {7C427E13-E012-4C29-97ED-1792BA40F063}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7C427E13-E012-4C29-97ED-1792BA40F063}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7C427E13-E012-4C29-97ED-1792BA40F063}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7C427E13-E012-4C29-97ED-1792BA40F063}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/MyGestureBank/PostureHandUpRight.cs b/MyGestureBank/PostureHandUpRight.cs index 347e97e..03f0f2b 100644 --- a/MyGestureBank/PostureHandUpRight.cs +++ b/MyGestureBank/PostureHandUpRight.cs @@ -33,6 +33,11 @@ namespace MyGestureBank } } + /// + /// Tests the posture. + /// + /// + /// A boolean indicating wheter the posture was detected or not. protected override bool TestPosture(Body body) { return body.Joints[JointType.HandRight].Position.Y > body.Joints[JointType.ShoulderRight].Position.Y; diff --git a/PostureTester/App.config b/PostureTester/App.config new file mode 100644 index 0000000..7b54b98 --- /dev/null +++ b/PostureTester/App.config @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PostureTester/PostureTester.csproj b/PostureTester/PostureTester.csproj new file mode 100644 index 0000000..450483c --- /dev/null +++ b/PostureTester/PostureTester.csproj @@ -0,0 +1,63 @@ + + + + + Debug + AnyCPU + {7C427E13-E012-4C29-97ED-1792BA40F063} + Exe + PostureTester + PostureTester + v4.8 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Microsoft.Kinect.2.0.1410.19000\lib\net45\Microsoft.Kinect.dll + + + + + + + + + + + + + + + + + + + + + {d70b7357-6ff8-4f35-a283-8db4217c0c85} + MyGestureBank + + + + \ No newline at end of file diff --git a/PostureTester/Program.cs b/PostureTester/Program.cs new file mode 100644 index 0000000..c838999 --- /dev/null +++ b/PostureTester/Program.cs @@ -0,0 +1,61 @@ +using Microsoft.Kinect; +using MyGestureBank; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace PostureTester +{ + public class Program + { + private static List> bones = new List>(); + + static void Main(string[] args) + { + // Create a body + Body[] body = new Body[1]; + + // Create a posture + PostureHandUpRight postureHandUpRight = new PostureHandUpRight(); + PostureHandUpLeft postureHandUpLeft = new PostureHandUpLeft(); + + // Make the body do the posture + bones.Add(new Tuple(JointType.Head, JointType.Neck)); + bones.Add(new Tuple(JointType.Neck, JointType.SpineShoulder)); + bones.Add(new Tuple(JointType.SpineShoulder, JointType.SpineMid)); + bones.Add(new Tuple(JointType.SpineMid, JointType.SpineBase)); + bones.Add(new Tuple(JointType.SpineShoulder, JointType.ShoulderRight)); + bones.Add(new Tuple(JointType.SpineShoulder, JointType.ShoulderLeft)); + bones.Add(new Tuple(JointType.SpineBase, JointType.HipRight)); + bones.Add(new Tuple(JointType.SpineBase, JointType.HipLeft)); + + // Bras droit + bones.Add(new Tuple(JointType.ShoulderRight, JointType.ElbowRight)); + bones.Add(new Tuple(JointType.ElbowRight, JointType.WristRight)); + bones.Add(new Tuple(JointType.WristRight, JointType.HandRight)); + bones.Add(new Tuple(JointType.HandRight, JointType.HandTipRight)); + bones.Add(new Tuple(JointType.WristRight, JointType.ThumbRight)); + + // Bras gauche + bones.Add(new Tuple(JointType.ShoulderLeft, JointType.ElbowLeft)); + bones.Add(new Tuple(JointType.ElbowLeft, JointType.WristLeft)); + bones.Add(new Tuple(JointType.WristLeft, JointType.HandLeft)); + bones.Add(new Tuple(JointType.HandLeft, JointType.HandTipLeft)); + bones.Add(new Tuple(JointType.WristLeft, JointType.ThumbLeft)); + + // Jambe droite + bones.Add(new Tuple(JointType.HipRight, JointType.KneeRight)); + bones.Add(new Tuple(JointType.KneeRight, JointType.AnkleRight)); + bones.Add(new Tuple(JointType.AnkleRight, JointType.FootRight)); + + // Jambe gauche + bones.Add(new Tuple(JointType.HipLeft, JointType.KneeLeft)); + bones.Add(new Tuple(JointType.KneeLeft, JointType.AnkleLeft)); + bones.Add(new Tuple(JointType.AnkleLeft, JointType.FootLeft)); + + } + } +} diff --git a/PostureTester/Properties/AssemblyInfo.cs b/PostureTester/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..c7c8c86 --- /dev/null +++ b/PostureTester/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Les informations générales relatives à un assembly dépendent de +// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations +// associées à un assembly. +[assembly: AssemblyTitle("PostureTester")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("workgroup")] +[assembly: AssemblyProduct("PostureTester")] +[assembly: AssemblyCopyright("Copyright © workgroup 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly +// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de +// COM, affectez la valeur true à l'attribut ComVisible sur ce type. +[assembly: ComVisible(false)] + +// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM +[assembly: Guid("7c427e13-e012-4c29-97ed-1792ba40f063")] + +// Les informations de version pour un assembly se composent des quatre valeurs suivantes : +// +// Version principale +// Version secondaire +// Numéro de build +// Révision +// +// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut +// en utilisant '*', comme indiqué ci-dessous : +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/PostureTester/packages.config b/PostureTester/packages.config new file mode 100644 index 0000000..6350273 --- /dev/null +++ b/PostureTester/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file