Dotneteers.net
All for .net, .net for all!

Kinect Interactions with WPF - Part I: Getting Started

VBandi's blog

Syndication

Subscribe

Generic Content

Introduction

Microsoft has recently released V1.7 of the Kinect for Windows SDK. And they immediately made a mistake – there are so many new and awesome stuff in it, that it should be called 2.0 :)

The 1.7 SDK focuses on two key new features: Kinect Fusion and Kinect Interactions. Kinect Fusion is essentially a 3D scanner that enabled developers to create accurate 3D renderings in real time.

image

Kinect Fusion. Source: Kinect for Windows blog

 

While Kinect Fusion is beyond awesome, this blog post series focuses on the other big new feature of the Kinect for Windows (K4W) SDK 1.7: Kinect Interactions. Kinect Interactions allow developers to create interactive applications with a new, well-designed and ergonomically friendlier interaction language than before. The Kinect SDK can now detect a “push towards the screen” gesture to activate buttons, and this is the recommended “activate” gesture now instead of the old “hover, wait until the circle fills and its pressed” gesture.

Browsing lists larger than a dozen or so items has been even more difficult using Kinect. The recommended solution was to implement a “swipe from side” gesture, which paged through items on the screen. Here is such a list, straight from my XBox:

WP_20130322_002

You can see that the list has 358 games, and 5 of them are visible at the same time. To get through even half of this list, you would have to perform the swipe gesture 36 times! This is extremely slow, frustrating and physically exhausting.

The latest K4W SDK solves this issue by differentiating between an open and a closed hand. When you close your hand, you “grip” whatever’s underneath it (such as a scrollviewer), and then you can move your hand to scroll. If you release the scroller while your hand is still moving, the scrolling keeps happening – similarly to the inertia scroll you are already used to on touch devices. You can close your hand again at any time, and stop the inertia – again, as you expected.

In this post, I will help you to get started with Kinect Interactions by creating a Hello World WPF app that uses the features mentioned above. In later posts, I will dive deeper into the Kinect Interactions SDK, show you how to customize the existing controls, create new ones and go deep into the lower levels of the InteractionStream to invent new ways of interacting with your app. But first, let’s see how you can get started with Kinect Interactions today!

Note: I am assuming that you are familiar with C# and WPF for this article series.

First Things First – Download and Install the bits

Assuming you already have a Kinect for Windows device (or at least a Kinect for XBox one, which doesn’t support Near Mode, but can be legally used for development, but not “going live”), the next step is to install the SDK. Head over to Kinect Developer Downloads and download and install the SDK, and then the Kinect for Windows Developer Toolkit. After everything is done, launch the Kinect Developer Toolkit Browser from your start menu, and verify that the computer sees your Kinect by launching the “Kinect Explorer – WPF” sample. If all’s good, you can play a little with the samples called “Controls Basics – WPF” and “Interaction Gallery – WPF” to experience Kinect Interactions for yourself.

Create the Project

First, create a new WPF Application project called “GettingStarted”.

image

 

Add the following references:

From the C:\Program Files\Microsoft SDKs\Kinect\v1.7\Assemblies\ folder, add Microsoft.Kinect.dll.

From the C:\Program Files\Microsoft SDKs\Kinect\Developer Toolkit v1.7.0\Assemblies\ folder, add Kinect.Toolkit.dll, Kinect.Toolkit.Controls.dll and Kinect.Toolkit.Interaction.dll

Initializing the Kinect Sensor with KinectSensorChooser

The first control we will use from the Microsoft.Kinect.Toolkit.Controls namespace is the KinectSensorChooserUI. It is a fairly boring control, but it is nonetheless important: it indicates the status of the Attached Kinect Sensor, and can inform the user if the sensor is unplugged, plugged into the wrong USB port, etc.

In the MainView.xaml, add the following namespace:

xmlns:k=http://schemas.microsoft.com/kinect/2013

Then add the KinectSensorChooserUI control to the main grid:

<Grid>
    <k:KinectSensorChooserUI HorizontalAlignment="Center" VerticalAlignment="Top" Name="sensorChooserUi" />
</Grid>

 

We also need to initialize the KinectSensorChooser from the codebehind with some boilerplate code (I took these from the K4W samples).

Add a private field to the MainWindow codebehind:

private KinectSensorChooser sensorChooser;

 

Set up an event handler for the OnLoaded event in the MainWindow constructor (or in XAML, as you wish):

public MainWindow()
{
    InitializeComponent();
    Loaded += OnLoaded;
}

 

And create the OnLoaded event handler:

private void OnLoaded(object sender, RoutedEventArgs routedEventArgs) 
{ 
    this.sensorChooser = new KinectSensorChooser(); 
    this.sensorChooser.KinectChanged += SensorChooserOnKinectChanged; 
    this.sensorChooserUi.KinectSensorChooser = this.sensorChooser; 
    this.sensorChooser.Start(); 
}

 

If a sensor is chosen or got initialized, the code above will invoke the SensorChooserOnKinectChanged event handler. Let’s keep this one simple for now, just add a MessageBox to indicate things happened:

private void SensorChooserOnKinectChanged(object sender, KinectChangedEventArgs args) 
{ 
    MessageBox.Show(args.NewSensor == null ? "No Kinect" : args.NewSensor.Status.ToString()); 
}
 

Now we can run the app. First, let’s see what happens if there are no Kinects connected to the computer:

image

Also, sensorChooser.Kinect is null in this case.

If the mouse is moved over the little box above, it expands, and shows a more detailed help on the required action. Nice!

image

The help link takes you to a Microsoft web page about Kinect for Windows.

If you connect the Kinect Sensor now, the KinectSensorChooserUI will switch to an “Initializing” mode:

image

With the mouse hovering over it:

image

… and after a while, the Kinect sensor will be initialized, and the event handler with the MessageBox will get called:

image

After this, the Kinect chooser UI disappears until there’s a problem.

The KinectChooserUI control can also warn the user to move the Kinect to another USB port, check the power supply, etc. Here are the possible statuses:

public enum KinectStatus 
{ 
  Undefined, 
  Disconnected, 
  Connected, 
  Initializing, 
  Error, 
  NotPowered, 
  NotReady, 
  DeviceNotGenuine, 
  DeviceNotSupported, 
  InsufficientBandwidth, 
}

Setting up the Kinect for Interactions

Now that we made sure that we have a properly connected Kinect sensor, it’s time to get it to work with some more boilerplate code. Let’s replace the temporary SensorChooserOnKinectChanged event handler with the real stuff:

   1:  private void SensorChooserOnKinectChanged(object sender, KinectChangedEventArgs args)
   2:  {
   3:      bool error = false;
   4:      if (args.OldSensor != null)
   5:      {
   6:          try
   7:          {
   8:              args.OldSensor.DepthStream.Range = DepthRange.Default;
   9:              args.OldSensor.SkeletonStream.EnableTrackingInNearRange = false;
  10:              args.OldSensor.DepthStream.Disable();
  11:              args.OldSensor.SkeletonStream.Disable();
  12:          }
  13:          catch (InvalidOperationException)
  14:          {
  15:              // KinectSensor might enter an invalid state while enabling/disabling streams or stream features.
  16:              // E.g.: sensor might be abruptly unplugged.
  17:              error = true;
  18:          }
  19:      }
  20:   
  21:      if (args.NewSensor != null)
  22:      {
  23:          try
  24:          {
  25:              args.NewSensor.DepthStream.Enable(DepthImageFormat.Resolution640x480Fps30);
  26:              args.NewSensor.SkeletonStream.Enable();
  27:   
  28:              try
  29:              {
  30:                  args.NewSensor.DepthStream.Range = DepthRange.Near;
  31:                  args.NewSensor.SkeletonStream.EnableTrackingInNearRange = true;
  32:                  args.NewSensor.SkeletonStream.TrackingMode = SkeletonTrackingMode.Seated;
  33:              }
  34:              catch (InvalidOperationException)
  35:              {
  36:                  // Non Kinect for Windows devices do not support Near mode, so reset back to default mode.
  37:                  args.NewSensor.DepthStream.Range = DepthRange.Default;
  38:                  args.NewSensor.SkeletonStream.EnableTrackingInNearRange = false;
  39:                  error = true;
  40:              }
  41:          }
  42:          catch (InvalidOperationException)
  43:          {
  44:              error = true;
  45:              // KinectSensor might enter an invalid state while enabling/disabling streams or stream features.
  46:              // E.g.: sensor might be abruptly unplugged.
  47:          }
  48:      }
  49:  }

This code handles properly Shutting down the old Kinect Sensor (you can have multiple sensors connected to the PC) and starts up the Depth- and Skeleton streams for the new one. In Lines 31 and 32, near mode and seated skeleton tracking are turned on – these are optional, but I found them useful for my little developer corner.

The Kinect Region

The last step before we can see something from Kinect Interactions is to add a KinectRegion to the XAML. KinectRegion is the key element of Kinect Interactions on WPF: it is the screen area where interactive elements are placed and can be manipulated. KinectRegion is also responsible for displaying and moving the hand cursor. An application can have multiple KinectRegions, but they cannot be nested. Each KinectRegion can have their own respective Kinect sensor.

Let’s add a KinectRegion to the main Grid of the MainWindow, thus making it stretch the entire window:

<k:KinectRegion Name="kinectRegion"> 
</k:KinectRegion> 

 

Also, let’s make sure that the KinectSensor property of this KinectRegion is set to the actual Kinect by adding the following at the end of the SensorChooserOnKinectChanged event:

if (!error) 
    kinectRegion.KinectSensor = args.NewSensor; 

 

If you run the app now, you get one more error:

“Unable to invoke library 'KinectInteraction170_32.dll'.”

image

This is a common problem with Kinect beginners. The dll mentioned can be a bit tricky to find. The simplest way is to install the Controls Basics – WPF source code from the Developer Toolkit Browser (press the Install button) – or just download the sample project for this article (as long as you are targeting the same, 1.7 Kinect SDK).

image

Go to the AnyCPU.Debug folder of the sample’s installation directory and copy the KinectInteraction170_32.dll and KinectInteraction170_64.dll files to your project’s output directory. Now the app should run. Note: you may have to wait as much as 20 seconds for the Kinect Sensor to initialize. During this process, your application will not respond and will show a wait cursor if you move the mouse over it.

If all is OK, you should be able to raise one of your hands in front of you, and see a Hand Cursor representing it in your Main Window. You may have to wiggle around a bit so that the Kinect Sensor can detect you as a user.

image

For the screenshot above, I have also launched Kinect Studio. The Depth Viewer and Kinect Studio windows are not part of our application. Kinect Studio helps monitor the data our application receives. It can also record the Kinect’s output and allows you to play back the same user actions later. You can learn more about Kinect Studio on MSDN.

User Viewer

The next control we discuss is the Microsoft.Kinect.Toolkit.Controls.KinectUserViewer. Let’s add it to the main Grid:

<k:KinectUserViewer VerticalAlignment="Top" HorizontalAlignment="Center" 
k:KinectRegion.KinectRegion="{Binding ElementName=kinectRegion}" Height="100" />
 

The KinectUserViewer displays the depth pixels that belong to an identified user or users. You can use the KinectUserViewer control to make sure that the Kinect SDK “sees” you as a human and is able to separate you from the surroundings. If you see nothing in the KinectUserViewer (after the Kinect initialization has finished), it means that the Kinect is not tracking you, it hasn’t identified you as a person yet. Try to move around, and remember that you need to be at least a meter (or even more) away from the sensor for it to detect you.

image

image

Interactive Controls

So far we managed to notify the user of the Kinect Sensor’s state, put a hand cursor on the screen that followed the user’s hand and to show an outline of the user. It’s time for the hand to actually do something! The first such something is going to be pressing a button.

The KinectTileButton

The KinectTileButton is one of the simplest controls available. It resembles a Windows 8-style tile with a template-able label and a Content that is just like the content of the regular Button control. Here is a very simple declaration of the KinectTileButton that should be put inside the main Grid of MainWindow.xaml:

<k:KinectTileButton Label="Press me!" Click="ButtonOnClick"></k:KinectTileButton>

 

To handle the button’s Click event, let’s just do a simple MessageBox:

private void ButtonOnClick(object sender, RoutedEventArgs e) 
{ 
    MessageBox.Show("Well done!"); 
}
 

The KinectButton control has a nice Kinect-purple color by default. Here’s what it looks like: (Note: I’ve changed window height and width to 600x500 for more space)

image

If you move the hand cursor over the KinectButton it grows a little to indicate the “hover” state. The hand cursor also changes subtly.

 

image

If you start to move your hand towards the screen (attempting to perform the “press” gesture), the hand will begin to fill up with a purple circular pattern.

 

image

When you actually press the button, the button will play some visual effects, and the cursor’s fill color will change again. Then, our ugly little MessageBox will show up, indicating that the button has indeed been pressed, and the proper event handler was called. Nice!

image

The KinectCircleButton

The next button type works a lot like the KinectTileButton. However, in order to show it, we first need to change the existing xaml a little bit. The KinectRegion is a ContentControl, which means it can only have one child. Luckily, this Child can be a control that in turn can contain multiple children – such as a Grid or a StackPanel. For now, we will need to surround the existing KinectTileButton with a Grid. I’ve also moved the KinectTileButton to the left side to leave some space for the KinectCircleButton we are about to add. The button has a content (which, again can be anything, including an image or a much more complex element), and a Label. The KinectCircleButton resembles the RoundButton of Windows Phone. Let’s add it to the Grid we just added inside the Kinectregion:

<k:KinectCircleButton Label="Circle" HorizontalAlignment="Right" Height="200" Click="ButtonOnClick">Hi</k:KinectCircleButton>

 

This is what the application looks like now:

image

Moving the hand above the KinectCircleButton, we can see that it also has an “over” state, and changes the look of the hand just like the KinectTileButton did.

image

Moving the hand towards the screen:

image

… and finally pressing it:

image

 

It is good to know that these interactive elements also work with the mouse. This way you can test the app itself without using Kinect. Kinect initialization can takes 15 seconds or more, so to test your app’s logic, UI and flow, you may even want to disconnect the Kinect to get the app started faster.

They See Me Scrollin’

As I said in the Introduction, browsing a big list of items and selecting the one you want has always been difficult with Kinect – but with the latest Kinect SDK, this situation is vastly improved. The key is the third (and last) out-of-the-box control of the 1.7 SDK: the KinectScrollViewer. Let’s place a KinectScrollViewer at the bottom of our window by pasting the code below into the Grid inside the KinectRegion:

<k:KinectScrollViewer VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto" VerticalAlignment="Bottom">
   <StackPanel Orientation="Horizontal" Name="scrollContent" />
</k:KinectScrollViewer>

This looks exactly like a standard WPF ScrollViewer. It even has a StackPanel called “scrollContent”, and these two controls are set up to scroll horizontally. Let’s fill up the StackPanel with some KinectCircleButtons. For this, add the following lines to the OnLoaded event handler in the code behind:

 

//fill scroll content
for (int i = 1; i < 20; i++)
{
    var button = new KinectCircleButton
                        {
                            Content = i,
                            Height = 200
                        };

    int i1 = i;
    button.Click +=
        (o, args) => MessageBox.Show("You clicked button #" + i1);

    scrollContent.Children.Add(button);
}

If we run the application now, this is what it looks like:

image

Moving the hand over the scrollable area, it changes color:

image

The trick now is to close your hand and make a fist, as if you were grabbing something. The hand cursor will change, indicating that you indeed grabbed onto the KinectScrollViewer:

image

Now you can move your hand, and the KinectScrollViewer will “stick to it”, much like when you scroll a list on a touch device, such as a phone or a tablet. If you open your hand, you will release the KinectScrollViewer. If you push your hand forward, you can select easily one of the items in the list and get the corresponding MessageBox:

image

Download

You can download the demo project for this article here.

Summary

In this post, I’ve introduced you to the basics to get started with a Kinect Interactions application – getting the Kinect sensor up and running, defining a KinectRegion, adding buttons and scrollable areas to it.

In the next posts of this series, I will dive deeper into the world of Kinect Interactions. We will dive deeper into the – unfortunately very sparsely documented – controls I discussed above, and see the customization options they offer. And finally, going deeper into the rabbit hole, we will examine the low level Interaction Stream.


Posted Mar 25 2013, 03:24 PM by vbandi

Comments

Kinect Interactions with WPF - Part I: Getting Started wrote Kinect Interactions with WPF - Part I: Getting Started
on Tue, Mar 26 2013 12:38

Pingback from  Kinect Interactions with WPF - Part I: Getting Started

Dew Drop – March 26, 2013 (#1,514) | Alvin Ashcraft's Morning Dew wrote Dew Drop &ndash; March 26, 2013 (#1,514) | Alvin Ashcraft&#039;s Morning Dew
on Tue, Mar 26 2013 13:39

Pingback from  Dew Drop – March 26, 2013 (#1,514) | Alvin Ashcraft's Morning Dew

Vrane wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Tue, Mar 26 2013 21:45

In text u are missing part of code:

User Viewer - then little below u are missing

Binding ElementName=kinectRegion}" Height="100" UserColoringMode="Manual" />

vbandi wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Tue, Mar 26 2013 22:01

Thanks Vrane, fixed it.

Carchie wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Wed, Mar 27 2013 20:24

Best introduction to v1.7 Kinect WPF controls.  Thanks! Now I can understand the sdk examples.  Hoping now to find some help on fusion.

rokko101 wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Wed, Mar 27 2013 20:53

great introduction!! thank you so much

Vuyiswa Maseko wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Fri, Mar 29 2013 7:00

nice info. as the sdk is new i think its me and you who explained this.

NIck R wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Sat, Mar 30 2013 3:30

Would it be possible to substitute the MessageBox for an image? If so could someone please explain how, I'm relatively new to c sharp and help is much appreciated.  

Sr B wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Wed, Apr 3 2013 9:24

Thanks for the great example! I have been following it step by step and even though everything compiles and executes properly, i can not see the cursor, even with the downloadable code. What would it be missing?

Thanks

vbandi wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Wed, Apr 3 2013 9:50

Sr B: Probably the sensor cannot identify and track your skeleton. Make sure that you are at least 1.5-2 meters away from the sensor and that it can see you properly. If you have a Kinect for Xbox sensor, you may have to be even further away, since there is no near mode there. Try using the Kinect Studio to monitor how much the sensor sees of you.

vbandi wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Wed, Apr 3 2013 9:52

Nick R: Sorry, explaining that goes beyond what I can do in a little comment here. I really recommend getting to know WPF before venturing further. There are some awesome WPF tutorials on the net. Good luck!

Sr B wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Wed, Apr 3 2013 13:24

I did that, and it should work because all the demos of the toolkit works. However i manage to mix your tuto with the ControlsBasics - WPF demo and i just made it work, and what it is more important, understand!

I must be missing sth...

Thanks a lot anyway!

sgthompson wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Wed, Apr 3 2013 22:45

It is so good to have someone walk through the code for the SDK example. Makes a lot more sense.

How can you view the scrollbar region in the xaml? I noticed that you used stackpanel rather than wrappanel as show in the control basics example in the SDK. Is this the reason?

thanks again for the walkthrough

Veytizou (veytizoujulien) | Pearltrees wrote Veytizou (veytizoujulien) | Pearltrees
on Thu, Apr 4 2013 7:50

Pingback from  Veytizou (veytizoujulien) | Pearltrees

guy wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Thu, Apr 4 2013 13:17

thank u so much!!

not working for XBOX kinect... but the sdk 1.7 apps (for ex: "controls basic") do working.

Xav wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Sat, Apr 6 2013 19:52

Hi vbandi and thanks for this great tutorial ! I'm juste wondering if you have an idea on how to control windows with kinect and hand gestures. Microsoft promoted the new sdk with this video of microsoft research : www.youtube.com/watch

Unfortunately, they don't provide the code in the toolkit to do the same things.

Thank by advance for your answer.

vbandi wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Sat, Apr 6 2013 20:30

Hi Xav,

It is fairly straightforward to do so, at least on an experimental level. You have to create and install a new touch device, where the driver essentially takes its clues from a Kinect for Windows Interaction stream. Well - straightforward if you know how to create device drivers.

Xav wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Sat, Apr 6 2013 23:47

Thanks for your answer vbandi !

Unfortunately, I'm beginner in kinect programmation and create a device driver, well, I don't know anything about that.

My first idea was to start with the solution which consist to take  skeleton coordinates and send it to the cursor via the user32.dll. This technique is explain here : www.codeproject.com/.../The-Kinect-Mouse-Controller-Csharp or another one here : code.msdn.microsoft.com/.../sourcecode

So after that, I'm thinking to add the hand recognition which is allow by the 1.7 sdk.

But I've made a quick research about kinect for Windows interaction stream it's look like much harder to do, but, and I'm not sure about that, more reliable.

So, given that I'm beginner in kinect development, which solution is more appropiate according to you, and have you some advices to start ?

Thanks again for your time and your advice.

vbandi wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Sun, Apr 7 2013 0:15

I would not recommend going the skeleton route. There are tons of tweaks MS made to the way they interpret skeleton coordinates in the interaction stream that result in a lot of experiments, usability studies, etc. Look up the 1.7 SDK documentation for some of these. So, I would definitely go for the interaction stream. OTOH I also know nothing about creating a driver, but I'm pretty sure someone will come out with just a solution soon.

Nick R wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Sun, Apr 7 2013 3:19

vbandi: Thanks for the response, but I did in fact find a way to do it. If anyone else is curious, the way I did it was by causing the button click to change the items visibility state.

Xav wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Sun, Apr 7 2013 11:03

Thanks for your advice, I think I'm gonna wait the release of this driver. I think too that's a solution will come out soon according to this topic of msdn : social.msdn.microsoft.com/.../e4f5a696-ed4f-4a5f-8e54-4b3706f62ad0

vbandi wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Sun, Apr 7 2013 11:19

Nick, I am happy that you solved your problem!

Sergiu wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Sun, Apr 7 2013 22:20

Thank you very much for this. It was very useful to get me started on the new SDK

Daniel Accorsi wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Mon, Apr 8 2013 22:16

Hi, can I change the default hand cursor to another JPG ou PNG???

vbandi wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Mon, Apr 8 2013 22:54

Hello Daniel,

You will probably have to edit the template of the hand cursor control. I'll try to cover this in a later part of the series.

Sana Ata wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Tue, Apr 9 2013 17:56

thank you that was very helpful :)

but u didn't talk about "grip and release"

how can i use it ?!

Alvin wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Thu, Apr 11 2013 10:34

It really help! thank

and when is the next part will be release

really need it. Urgently.

thank in advance ^^

Anna wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Thu, Apr 11 2013 17:35

i really love this. can u do more ? it's clear and easy to understand . love it.

Leonardo wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Sat, Apr 13 2013 16:43

Congratulations for example, very useful.

You might have some example in WPF, or idea, of how to transition between pages?

Thank you.

Heli wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Mon, Apr 15 2013 12:04

Thanks for this tutorial. I have a problem with my Xbox Kinect. It doesn't work with this code. Do you maybe know what could be a problem? There are no errors and application runs normally but there is no cursor. Thanks!

vbandi wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Mon, Apr 15 2013 12:41

Heli: Sorry, I haven't tried it with an Xbox Kinect. Try disabling Near Mode (SensorChooserOnKinectChanged), and stand about two meters from the sensor.

Heli wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Mon, Apr 15 2013 14:28

Thank you! I removed this part and it's working now:

try

                   {

                       args.NewSensor.DepthStream.Range = DepthRange.Near;

                       args.NewSensor.SkeletonStream.EnableTrackingInNearRange = true;

                       args.NewSensor.SkeletonStream.TrackingMode = SkeletonTrackingMode.Seated;

                   }

                   catch (InvalidOperationException)

                   {

                       // Non Kinect for Windows devices do not support Near mode, so reset back to default mode.

                       args.NewSensor.DepthStream.Range = DepthRange.Default;

                       args.NewSensor.SkeletonStream.EnableTrackingInNearRange = false;

                       error = true;

                   }

Vagner Santos wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Thu, Apr 18 2013 19:58

Hello, my name is Vagner and I'm from Brazil.

I really liked your explanation, it was really a great job.

You could do the same with the example called Interaction Gallery-WPF  from Kinect for Windows WPF Developer ToolKit's example?

Vagner Santos wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Thu, Apr 18 2013 20:00

Hello, my name is Vagner and I'm from Brazil.

I really liked your explanation, it was really a great job.

You could do the same with the example called Interaction Gallery-WPF  from Kinect for Windows WPF Developer ToolKit's example?

Ricardo Basulto wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Wed, Apr 24 2013 6:06

Excelente, gracias. from Chile.

shashi patil wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Thu, Apr 25 2013 13:51

cool!

Alain Lescouflair wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Mon, Apr 29 2013 21:02

Hi, thanks for this tutorial :) , it's one of the main reason I left the SDK 1.6 to the 1.7 and it helped me do much more and corrected some bugs I was facing.

But now I have a question ?

Before I used to had some simple gestures somewhere in the squeleton controller where I make the hand cursor follow my active hand.. I mean simple gestures like raising my left hand over my head. Now where do I put these kinds of stuff since I don't code all the tracking part ?

Thanks

Valdenir Santana wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Tue, Apr 30 2013 4:55

Hello friends,

I am Brazilian and I want to congratulate vbandi the first post. Very good guide. Keep posting things for people, it is very useful.

I believe that you are using the kinect for windows, and I'm using the kinect for XBOX 360.

Some people are saying that even downloading the project source and running the sensor does not find people. I also had to solve this problem and I put these two lines right after the Star () sensor;

             regionSensorBinding var = new Binding ("Kinect") {Source = this.sensorChooser};

             BindingOperations.SetBinding (this.kinectRegion, KinectRegion.KinectSensorProperty, regionSensorBinding);

Skewer helped!

My email is valdenirsantana@outlook.com or valdenirsantana@gmail.com.

vbandi wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Tue, Apr 30 2013 9:49

Alain: you can still use the Skeleton to do that. Also, look out for my upcoming post on the Interaction Stream, which will also explain how you can get hand coordinates, etc.

vbandi wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Tue, Apr 30 2013 9:49

Valdenir: thanks!

Morten wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Tue, Apr 30 2013 13:23

Way to go man, cool introductions - cudos!

benajmin wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Tue, Apr 30 2013 16:00

Hello, Thank you very much for this great article on dotneteers.net.

I have read a whole bunch of Kinect based articles lately and yours in one of the best yet.

I too have been creating kinect application and controllers. However I have run into a brick wall with development. I am stuck.

I can't seem to figure out the event handlers for the InteractionFrameReady.

I am really trying to get my app to know if I made a "fist" or "release", but to be honest I am stumped.

I have referenced the ToolBox DLL and I seem to be able to get the Event handlers looking fine without any "Visual Studio Red Squiggles", But I am not sure how to map the Data to the user.

Perhaps you would be interested in emailing me some suggestions, should you find the time.

Either way thank you so much for a great article

Ben

gartanto wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Mon, May 13 2013 10:21

hi...

thnks for the tutorial.

can you give example to using two hands?

Mike wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Thu, May 16 2013 11:44

someone has an example with two hands?

Fikre wrote re: Kinect Interactions with WPF - Part I: Getting Started
on Wed, May 22 2013 0:14

Any Idea how to get rid of the "Unable to invoke library 'KinectInteraction170_32.dll'" error when running the sdk from an Asp.Net MVC application rather than a windows app. I have followed the same steps and ensured that the dlls are copied to the output directory, but still get the same error

Kinect Interaction | 52 Coding wrote Kinect Interaction | 52 Coding
on Sat, May 25 2013 10:48

Pingback from  Kinect Interaction | 52 Coding

KTU – 体感开发者协作博客 » Kinect Interaction wrote KTU &#8211; 体感开发者协作博客 &raquo; Kinect Interaction
on Sat, May 25 2013 11:24

Pingback from  KTU – 体感开发者协作博客 » Kinect Interaction

Starting Experience in Kinect | Developer Gone Wrong wrote Starting Experience in Kinect | Developer Gone Wrong
on Tue, Jun 18 2013 4:46

Pingback from  Starting Experience in Kinect | Developer Gone Wrong

How to display a WPF page or window without waiting for hea | User17 wrote How to display a WPF page or window without waiting for hea | User17
on Wed, Aug 28 2013 17:08

Pingback from  How to display a WPF page or window without waiting for hea | User17

App’ WPF pour Kinect Tutoriel | Mon Dev Perso wrote App&rsquo; WPF pour Kinect Tutoriel | Mon Dev Perso
on Tue, Jan 7 2014 23:54

Pingback from  App’ WPF pour Kinect Tutoriel | Mon Dev Perso