As I have been writing my series on using sensors with Windows and .NET, it occurred to me that I actually had a pretty amazing set of sensors sitting unused – the Kinect device from my XBox One.
I don’t have any games that really use the XBox One, and with some of the refinements to the console operating system, I’ve found it to be easier to use the gamepad than to use voice commands.
I knew that the Kinect for the XBox 360 wasn’t compatible with my PC, and that there’s actually a separate Kinect for Windows device – but after a little research, I found that the Kinect for the XBox One could work with a PC, as long as it was connected through an adapter.
I want to write about my experiences – as usual, things didn’t work quite as smoothly as I’d have liked! Hopefully my experiences will be useful to someone else out there.
Installing the Kinect Software SDK
As I mentioned above, my Kinect wouldn’t connect to a PC directly, it needed to go through an adapter. There were some other system requirements listed at this link.
If I were starting this process again, I would install the SDK (available here) before purchasing the Kinect Adapter. This ships is a tool which analyses your PC for compatibility, and would have told me if my PC wasn’t good enough. Fortunately it was good enough, but it could have been an expensive mistake if I bought the adapter and found my machine wasn’t up to the job.
Step 1: Download the Kinect for Windows SDK 2.0
The SDK is freely available for download from this link.
When the SDK has downloaded, you double click on the executable to start the installation process. The first thing you’ll be challenged to do is to accept the licence agreement and click Install.
The install is pretty straightforward, and if it successfully installs it will finish on the screen below:
At this point, it’s possible to load up the verification tool – there will be a new Windows app called “SDK Browser 2.0 (Kinect for Windows)”. You can search for this through the Windows Start menu. If you start this up, you’ll see a screen something like the one below.
You can see at the top of the list, there’s a component named “Kinect Configuration Verifier”, which has a “Run” button on the right hand side. If you click on Run, you’ll see a screen like the one below.
After a few seconds, this should change to a screen like the one below:
Hopefully your machine will have green ticks against everything – in my system, I don’t have a Kinect connected yet – therefore the “Kinect Connected” test has failed, as has the “Verify Kinect Depth and Color Streams” test.
Step 2: Connecting the Kinect Device
I set up my Kinect device in the configuration shown in the Microsoft site, also displayed below. I plugged this into the electrical power, and also connected the USB cable into the USB 3.0 port on my PC.
Using USB 3.0 is really important – I also tried it with a USB 2 socket, and this didn’t work.
There were some alerts as Windows installed the drivers for the Kinect, but I was able to check that the Kinect had installed correctly by looking at the Device Manager. There is a new node for Kinect sensor devices, shown below:
Under the Sound, video and game controllers now there was a new item called Xbox NUI Sensor, shown below:
And finally, under Audio inputs and outputs, there is a new item called “Microphone Array (Xbox NUI Sensor)”.
After this point, I re-ran the verification tool, expecting different results as the Kinect sensor was connected to the machine. The results are shown below.
Unfortunately one of the tests failed – “Verify Kinect Depth and Color Streams”. This is very strange, as when I expanded the item to see more details, I was clearly able to see the output from the Kinect sensor, with a frame-rate varying between 20 – 30 FPS.
Other people have not been so lucky. I’ve included some links below which might be helpful.
Testing the Kinect out with some of the samples
Obviously I’d some concerns that my Kinect wasn’t going to work given that one of the verification tests had failed, but I pressed on with some experiments.
The first application I tested was “Face Basics-WPF”. This demonstrates how to use the FaceFrameReader to obtain information about the faces that the Kinect sees.
After running the application, I found that my face was detected if I stood back a couple of metres from the sensor – I’ve shown the output below. Basically everything detected in the image is correct – although it’s a shame it didn’t detect me as being happy! This value changed depending on whether I was smiling or not, which shows the level of detail that the Kinect and its software is able to pick up.
I found that this application was installed on my machine in the location:
C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\Samples\Managed\FaceBasics-WPF
Discrete Gesture Basics-WPF
The next application I tested was the “Discrete Gesture Basics-WPF” application. This uses the VisualGestureBuilderFrame object to detect people in front of the sensor, and also to track gestures from these people. In the screenshot below, I’m standing a couple of metres in front of the Kinect, and my left hand is open and my right hand is closed (and you can see the different way each hand is displayed, the open hand is green and the closed hand is red). It’s a pretty good recognition of a person standing.
When I moved closed to the Kinect, and sat down in front of it, the Kinect correctly saw that I was seated, but I was too close to the Kinect for it to display a useful representation.
Again, I found this application installed to my hard disk at the location below:
C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\Samples\Managed\DiscreteGestureBasics-WPF
I’ve successfully tested the Kinect sensor for the XBox One with a PC, and found the process to get it working was actually really straightforward. I had to purchase a Kinect Adapter which cost my about £33 (in UK pounds sterling) to get this to work. I’m looking forward to starting some more development projects involving computer vision and speech recognition.