Merge pull request 'AllStreamsWork' (#17) from AllStreamsWork into dev

Reviewed-on: #17
pull/18/head
Johan LACHENAL 1 year ago
commit 18c08846d8

@ -54,10 +54,6 @@
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\LibMyGesturesBank\LibMyGesturesBank.csproj">
<Project>{2496dfb1-eb55-47a1-a780-211e079b289d}</Project>
<Name>LibMyGesturesBank</Name>
</ProjectReference>
<ProjectReference Include="..\Lib\Lib.csproj"> <ProjectReference Include="..\Lib\Lib.csproj">
<Project>{0751c83e-7845-4e5f-a5d3-e11aba393aca}</Project> <Project>{0751c83e-7845-4e5f-a5d3-e11aba393aca}</Project>
<Name>Lib</Name> <Name>Lib</Name>

@ -1,5 +1,4 @@
using Lib; using Lib;
using LibMyGesturesBank;
using Microsoft.Kinect; using Microsoft.Kinect;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

@ -7,10 +7,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfApp", "WpfApp\WpfApp.csp
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lib", "Lib\Lib.csproj", "{0751C83E-7845-4E5F-A5D3-E11ABA393ACA}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lib", "Lib\Lib.csproj", "{0751C83E-7845-4E5F-A5D3-E11ABA393ACA}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibMyGesturesBank", "LibMyGesturesBank\LibMyGesturesBank.csproj", "{2496DFB1-EB55-47A1-A780-211E079B289D}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyGesturesBank", "LibMyGesturesBank\MyGesturesBank.csproj", "{2496DFB1-EB55-47A1-A780-211E079B289D}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp", "ConsoleApp\ConsoleApp.csproj", "{27D9C879-52BB-4BD7-B08D-63A534AC6D7E}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp", "ConsoleApp\ConsoleApp.csproj", "{27D9C879-52BB-4BD7-B08D-63A534AC6D7E}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KinectUtils", "KinectUtils\KinectUtils.csproj", "{2D44487E-F514-4063-9494-2AF1E8C9E9C8}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -33,6 +35,10 @@ Global
{27D9C879-52BB-4BD7-B08D-63A534AC6D7E}.Debug|Any CPU.Build.0 = Debug|Any CPU {27D9C879-52BB-4BD7-B08D-63A534AC6D7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{27D9C879-52BB-4BD7-B08D-63A534AC6D7E}.Release|Any CPU.ActiveCfg = Release|Any CPU {27D9C879-52BB-4BD7-B08D-63A534AC6D7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{27D9C879-52BB-4BD7-B08D-63A534AC6D7E}.Release|Any CPU.Build.0 = Release|Any CPU {27D9C879-52BB-4BD7-B08D-63A534AC6D7E}.Release|Any CPU.Build.0 = Release|Any CPU
{2D44487E-F514-4063-9494-2AF1E8C9E9C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D44487E-F514-4063-9494-2AF1E8C9E9C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D44487E-F514-4063-9494-2AF1E8C9E9C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D44487E-F514-4063-9494-2AF1E8C9E9C8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KinectUtils
{
public class AllGesturesFactory : IGestureFactory
{
public IEnumerable<BaseGesture> CreateGestures()
{
throw new NotImplementedException();
}
}
}

@ -1,11 +1,7 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Kinect; using Microsoft.Kinect;
namespace LibMyGesturesBank namespace KinectUtils
{ {
public abstract class BaseGesture public abstract class BaseGesture
{ {

@ -0,0 +1,33 @@
using Microsoft.Kinect;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KinectUtils
{
class BaseMapping<T>
{
public void SubscribeToStartGesture(BaseGesture gesture)
{
throw new NotImplementedException();
}
public void SubscribeToEndGesture(BaseGesture gesture)
{
throw new NotImplementedException();
}
public void SubscribeToToggleGesture(BaseGesture gesture)
{
throw new NotImplementedException();
}
protected T Mapping(Body body)
{
throw new NotImplementedException();
}
public bool TestMapping(Body body, out T output)
{
throw new NotImplementedException();
}
}
}

@ -0,0 +1,34 @@
using Microsoft.Kinect;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KinectUtils
{
abstract class Gesture : BaseGesture
{
protected int _maxNbOfFrames;
protected int _minNbOfFrames;
private int currentFrameCount;
public bool isRecognitionRunning { get; set; }
public int MinNbOfFrames {
get { return _minNbOfFrames; }
private set { _minNbOfFrames = value; }
}
public int MaxNbOfFrames
{
get { return _maxNbOfFrames; }
private set { _maxNbOfFrames = value; }
}
public override void TestGesture(Body body)
{
}
abstract protected bool TestInitialConditions(Body body);
abstract protected bool TestPosture(Body body);
abstract protected bool TestRunningGesture(Body body);
abstract protected bool TestEndConditions(Body body);
}
}

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Lib;
namespace KinectUtils
{
static class GestureManager
{
static event EventHandler GestureRecognized;
static KinectManager KinectManager { get; set; }
static List<BaseGesture> KnownGestures { get; set; }
static public void AddGestures(IGestureFactory factory)
{
KnownGestures = (List<BaseGesture>)factory.CreateGestures();
}
static public void AddGestures(params BaseGesture[] gestures)
{
foreach (var gesture in gestures)
{
KnownGestures.Add(gesture);
}
}
static public void RemoveGesture(BaseGesture gesture)
{
KnownGestures.Remove(gesture);
}
static public void StartAcquiringFrames(KinectManager kinectManager)
{
throw new NotImplementedException();
}
}
}

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KinectUtils
{
interface IGestureFactory
{
IEnumerable<BaseGesture> CreateGestures();
}
}

@ -0,0 +1,61 @@
<?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>{2D44487E-F514-4063-9494-2AF1E8C9E9C8}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>KinectUtils</RootNamespace>
<AssemblyName>KinectUtils</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<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' ">
<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" />
<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="AllGesturesFactory.cs" />
<Compile Include="BaseGesture.cs" />
<Compile Include="BaseMapping.cs" />
<Compile Include="Gesture.cs" />
<Compile Include="GestureManager.cs" />
<Compile Include="IGestureFactory.cs" />
<Compile Include="Posture.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Lib\Lib.csproj">
<Project>{0751c83e-7845-4e5f-a5d3-e11aba393aca}</Project>
<Name>Lib</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

@ -1,13 +1,12 @@
using System; using Microsoft.Kinect;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Microsoft.Kinect;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace LibMyGesturesBank namespace KinectUtils
{ {
public abstract class Posture : BaseGesture public abstract class Posture : BaseGesture
{ {
protected abstract bool TestPosture(Body body); protected abstract bool TestPosture(Body body);
@ -21,7 +20,5 @@ namespace LibMyGesturesBank
} }
} }
// Ajoutez ici d'autres méthodes ou propriétés nécessaires
} }
} }

@ -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("KinectUtils")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("KinectUtils")]
[assembly: AssemblyCopyright("Copyright © 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("2d44487e-f514-4063-9494-2af1e8c9e9c8")]
// 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")]

@ -44,6 +44,7 @@ namespace Lib
Bitmap = new WriteableBitmap(framedescription.Width, framedescription.Height, 96.0, 96.0, PixelFormats.Bgr32, null); Bitmap = new WriteableBitmap(framedescription.Width, framedescription.Height, 96.0, 96.0, PixelFormats.Bgr32, null);
reader = kinectmanager.Sensor.BodyFrameSource.OpenReader(); reader = kinectmanager.Sensor.BodyFrameSource.OpenReader();
reader.FrameArrived += Reader_BodyFrameArrived; reader.FrameArrived += Reader_BodyFrameArrived;
// initialiser le tableau des corps // initialiser le tableau des corps
this.bodies = new Body[kinectmanager.Sensor.BodyFrameSource.BodyCount]; this.bodies = new Body[kinectmanager.Sensor.BodyFrameSource.BodyCount];
Canvas = skeletonCanvas; Canvas = skeletonCanvas;

@ -18,10 +18,14 @@ namespace Lib
public BodyFrameReader Reader public BodyFrameReader Reader
{ {
get { return reader; } get { return reader; }
set { reader = value; } private set { reader = value; }
} }
//private ColorFrameReader colorReader; private ColorFrameReader _colorReader;
public ColorFrameReader ColorReader {
get { return _colorReader; }
private set { _colorReader = value; }
}
private Body[] bodies; private Body[] bodies;
public Body[] Bodies public Body[] Bodies
@ -36,6 +40,11 @@ namespace Lib
Reader.Dispose(); Reader.Dispose();
Reader = null; Reader = null;
} }
if(ColorReader != null)
{
ColorReader.Dispose();
ColorReader = null;
}
} }
@ -45,6 +54,8 @@ namespace Lib
Bitmap = new WriteableBitmap(framedescription.Width, framedescription.Height, 96.0, 96.0, PixelFormats.Bgr32, null); Bitmap = new WriteableBitmap(framedescription.Width, framedescription.Height, 96.0, 96.0, PixelFormats.Bgr32, null);
reader = kinectmanager.Sensor.BodyFrameSource.OpenReader(); reader = kinectmanager.Sensor.BodyFrameSource.OpenReader();
reader.FrameArrived += Reader_BodyFrameArrived; reader.FrameArrived += Reader_BodyFrameArrived;
ColorReader = KinectManager.Sensor.ColorFrameSource.OpenReader();
ColorReader.FrameArrived += Reader_ColorFrameArrived;
// initialiser le tableau des corps // initialiser le tableau des corps
this.bodies = new Body[kinectmanager.Sensor.BodyFrameSource.BodyCount]; this.bodies = new Body[kinectmanager.Sensor.BodyFrameSource.BodyCount];
Canvas = skeletonCanvas; Canvas = skeletonCanvas;
@ -167,5 +178,36 @@ namespace Lib
} }
} }
} }
private void Reader_ColorFrameArrived(object sender, ColorFrameArrivedEventArgs e)
{
using (ColorFrame colorFrame = e.FrameReference.AcquireFrame())
{
if (colorFrame != null)
{
// ... Logique existante pour traiter la frame
//Debug.WriteLine("Traitement de la frame de couleur.");
FrameDescription colorFrameDescription = colorFrame.FrameDescription;
using (KinectBuffer colorBuffer = colorFrame.LockRawImageBuffer())
{
this.Bitmap.Lock();
// Vérifier si la taille de l'image a changé
if ((colorFrameDescription.Width == this.Bitmap.PixelWidth) && (colorFrameDescription.Height == this.Bitmap.PixelHeight))
{
colorFrame.CopyConvertedFrameDataToIntPtr(
this.Bitmap.BackBuffer,
(uint)(colorFrameDescription.Width * colorFrameDescription.Height * 4),
ColorImageFormat.Bgra);
this.Bitmap.AddDirtyRect(new Int32Rect(0, 0, this.Bitmap.PixelWidth, this.Bitmap.PixelHeight));
}
this.Bitmap.Unlock();
}
//Debug.WriteLine("Frame de couleur traitée.");
}
}
}
} }
} }

@ -12,6 +12,7 @@ namespace Lib
Color, Color,
Depth, Depth,
IR, IR,
Body,
ColorAndBody ColorAndBody
} }
} }

@ -31,7 +31,8 @@ namespace Lib
{ KinectStreams.Color, () => new ColorImageStream(KinectManager) }, { KinectStreams.Color, () => new ColorImageStream(KinectManager) },
{ KinectStreams.Depth, () => new DepthImageStream(KinectManager) }, { KinectStreams.Depth, () => new DepthImageStream(KinectManager) },
{ KinectStreams.IR, () => new InfraredImageStream(KinectManager) }, { KinectStreams.IR, () => new InfraredImageStream(KinectManager) },
{ KinectStreams.ColorAndBody, () => new BodyImageStream(KinectManager,SkeletonCanvas) } { KinectStreams.Body, () => new BodyImageStream(KinectManager,SkeletonCanvas) },
{ KinectStreams.ColorAndBody, () => new ColorAndBodyImageStream(KinectManager,SkeletonCanvas) }
}; };
} }

@ -8,7 +8,7 @@
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LibMyGesturesBank</RootNamespace> <RootNamespace>LibMyGesturesBank</RootNamespace>
<AssemblyName>LibMyGesturesBank</AssemblyName> <AssemblyName>MyGesturesBank</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
@ -44,13 +44,17 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="BaseGesture.cs" />
<Compile Include="Posture.cs" />
<Compile Include="PostureHandsOnHead .cs" /> <Compile Include="PostureHandsOnHead .cs" />
<Compile Include="PostureHandUp.cs" /> <Compile Include="PostureHandUp.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RightHandUp.cs" />
<Compile Include="TwoHandsDragon.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\KinectUtils\KinectUtils.csproj">
<Project>{2d44487e-f514-4063-9494-2af1e8c9e9c8}</Project>
<Name>KinectUtils</Name>
</ProjectReference>
<ProjectReference Include="..\Lib\Lib.csproj"> <ProjectReference Include="..\Lib\Lib.csproj">
<Project>{0751c83e-7845-4e5f-a5d3-e11aba393aca}</Project> <Project>{0751c83e-7845-4e5f-a5d3-e11aba393aca}</Project>
<Name>Lib</Name> <Name>Lib</Name>

@ -1,11 +1,7 @@
using Microsoft.Kinect; using Microsoft.Kinect;
using System; using KinectUtils;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibMyGesturesBank namespace MyGesturesBank
{ {
public class PostureHandUp : Posture public class PostureHandUp : Posture
{ {

@ -1,11 +1,8 @@
using Microsoft.Kinect; using Microsoft.Kinect;
using System; using System;
using System.Collections.Generic; using KinectUtils;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibMyGesturesBank namespace MyGesturesBank
{ {
public class PostureHandsOnHead : Posture public class PostureHandsOnHead : Posture
{ {

@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
// Les informations générales relatives à un assembly dépendent de // 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 // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
// associées à un assembly. // associées à un assembly.
[assembly: AssemblyTitle("LibMyGesturesBank")] [assembly: AssemblyTitle("MyGesturesBank")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LibMyGesturesBank")] [assembly: AssemblyProduct("MyGesturesBank")]
[assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibMyGesturesBank
{
internal class RightHandUp
{
}
}

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibMyGesturesBank
{
internal class TwoHandsDragon
{
}
}

@ -22,12 +22,15 @@
<Button Content="Filtre 1" Margin="5" Click="ToColorImageStream"/> <Button Content="Filtre 1" Margin="5" Click="ToColorImageStream"/>
<Button Content="Filtre 2" Margin="5" Click="ToDepthImageStream"/> <Button Content="Filtre 2" Margin="5" Click="ToDepthImageStream"/>
<Button Content="Filtre 3" Margin="5" Click="ToInfraredImageStream"/> <Button Content="Filtre 3" Margin="5" Click="ToInfraredImageStream"/>
<Button Content="Filtre 4" Margin="5" Click="ToColorAndBodyImageStream"/> <Button Content="Filtre 4" Margin="5" Click="ToBodyImageStream"/>
<Button Content="Filtre 5" Margin="5"/> <Button Content="Filtre 5" Margin="5" Click="ToColorAndBodyImageStream"/>
</StackPanel> </StackPanel>
<Viewbox Grid.Row="2" Stretch="Uniform">
<Grid>
<Image Grid.Row="2" Source="{Binding CurrentKinectStream.Bitmap}" /> <Image Grid.Row="2" Source="{Binding CurrentKinectStream.Bitmap}" />
<Canvas Grid.Row="2" x:Name="skeletonCanvas" /> <Canvas Grid.Row="2" x:Name="skeletonCanvas" />
</Grid>
</Viewbox>
</Grid> </Grid>
</Window> </Window>

@ -97,6 +97,13 @@ namespace WpfApp
CurrentKinectStream.Start(); CurrentKinectStream.Start();
} }
private void ToBodyImageStream(object sender, RoutedEventArgs e)
{
CurrentKinectStream.Stop();
CurrentKinectStream = Factory[KinectStreams.Body];
Debug.WriteLine(CurrentKinectStream.GetType().Name);
CurrentKinectStream.Start();
}
private void ToColorAndBodyImageStream(object sender, RoutedEventArgs e) private void ToColorAndBodyImageStream(object sender, RoutedEventArgs e)
{ {
CurrentKinectStream.Stop(); CurrentKinectStream.Stop();

Loading…
Cancel
Save