Friend of the blog, Mike Taulty, shares some great hints, tips and information on the new Windows 10 Kinect driver and code samples...
I was really pleased to see this blog post;
announcing a new driver which provides more access to the functionality of the Kinect for Windows V2 into Windows 10 including for the UWP developer.
I wrote a little about this topic in this earlier post around 10 months ago when some initial functionality became available for the UWP developer;
and so it’s great to see that more functionality has become available and, specifically, that skeletal data is being surfaced.
I plugged my Kinect for Windows V2 into my Surface Pro 3 and had a look at the driver being used for Kinect.
Getting Skeletal Data Into a C# UWP App
Rather than attempting to ‘port’ the C++ sample, I started by lifting pieces of the code that I’d written for that earlier blog post into a new project.
I made a blank app targeting SDK 14393, made sure that it had access to webcam and microphone and then added in win2d.uwp as a NuGet package and added a little UI;
The code is quite rough and ready as I was learning as I went along and some next steps might be to;
- Draw joints that are inferred in a different colour to those that are properly tracked.
- Draw the skeleton rather than just the joints.
- Do quite a lot of optimisations as the code here allocates a lot.
- Do more tracking around entities arriving/leaving based on their IDs and handle multiple people with different colours.
- Refactor to specialise the mtMediaSourceReader class to have separate types for Color/Depth/Custom and thereby tidy up the code which uses this type.
but, for now, I was just trying to get some basics working.
Here’s the code on GitHub if you want to try things out and note that you’d need that additional sample code from the official samples to make it work.