good base to start this exercise !

exo2
Nicolas FRANCO 1 year ago
parent 28c8bb6b1f
commit 4aeb2b3fd8

@ -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

@ -33,6 +33,11 @@ namespace MyGestureBank
}
}
/// <summary>
/// Tests the posture.
/// </summary>
/// <param name="body"></param>
/// <returns>A boolean indicating wheter the posture was detected or not.</returns>
protected override bool TestPosture(Body body)
{
return body.Joints[JointType.HandRight].Position.Y > body.Joints[JointType.ShoulderRight].Position.Y;

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7C427E13-E012-4C29-97ED-1792BA40F063}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>PostureTester</RootNamespace>
<AssemblyName>PostureTester</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Kinect, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Kinect.2.0.1410.19000\lib\net45\Microsoft.Kinect.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MyGestureBank\MyGestureBank.csproj">
<Project>{d70b7357-6ff8-4f35-a283-8db4217c0c85}</Project>
<Name>MyGestureBank</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

@ -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<Tuple<JointType, JointType>> bones = new List<Tuple<JointType, JointType>>();
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, JointType>(JointType.Head, JointType.Neck));
bones.Add(new Tuple<JointType, JointType>(JointType.Neck, JointType.SpineShoulder));
bones.Add(new Tuple<JointType, JointType>(JointType.SpineShoulder, JointType.SpineMid));
bones.Add(new Tuple<JointType, JointType>(JointType.SpineMid, JointType.SpineBase));
bones.Add(new Tuple<JointType, JointType>(JointType.SpineShoulder, JointType.ShoulderRight));
bones.Add(new Tuple<JointType, JointType>(JointType.SpineShoulder, JointType.ShoulderLeft));
bones.Add(new Tuple<JointType, JointType>(JointType.SpineBase, JointType.HipRight));
bones.Add(new Tuple<JointType, JointType>(JointType.SpineBase, JointType.HipLeft));
// Bras droit
bones.Add(new Tuple<JointType, JointType>(JointType.ShoulderRight, JointType.ElbowRight));
bones.Add(new Tuple<JointType, JointType>(JointType.ElbowRight, JointType.WristRight));
bones.Add(new Tuple<JointType, JointType>(JointType.WristRight, JointType.HandRight));
bones.Add(new Tuple<JointType, JointType>(JointType.HandRight, JointType.HandTipRight));
bones.Add(new Tuple<JointType, JointType>(JointType.WristRight, JointType.ThumbRight));
// Bras gauche
bones.Add(new Tuple<JointType, JointType>(JointType.ShoulderLeft, JointType.ElbowLeft));
bones.Add(new Tuple<JointType, JointType>(JointType.ElbowLeft, JointType.WristLeft));
bones.Add(new Tuple<JointType, JointType>(JointType.WristLeft, JointType.HandLeft));
bones.Add(new Tuple<JointType, JointType>(JointType.HandLeft, JointType.HandTipLeft));
bones.Add(new Tuple<JointType, JointType>(JointType.WristLeft, JointType.ThumbLeft));
// Jambe droite
bones.Add(new Tuple<JointType, JointType>(JointType.HipRight, JointType.KneeRight));
bones.Add(new Tuple<JointType, JointType>(JointType.KneeRight, JointType.AnkleRight));
bones.Add(new Tuple<JointType, JointType>(JointType.AnkleRight, JointType.FootRight));
// Jambe gauche
bones.Add(new Tuple<JointType, JointType>(JointType.HipLeft, JointType.KneeLeft));
bones.Add(new Tuple<JointType, JointType>(JointType.KneeLeft, JointType.AnkleLeft));
bones.Add(new Tuple<JointType, JointType>(JointType.AnkleLeft, JointType.FootLeft));
}
}
}

@ -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")]

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Kinect" version="2.0.1410.19000" targetFramework="net48" />
</packages>
Loading…
Cancel
Save