The most asked for snippet of code at our recent workshop that I didn’t have was how to properly align a Kinect skeleton to either the Video image or the depth image. It turns out this is non trivial and most samples that just scale all three items to fit the screen are wrong. I took the time this weekend to make a good sample for others to follow. If you just want the two snippets scroll to the very bottom of the article otherwise continue reading for a full walkthrough, it starts with Kinect Beta2 clean WPF code.

KinectSkeleonAlignment

Download the full code here.

The two key methods we are going to use are:

Microsoft.Research.Kinect.Nui.SkeletonEngine.SkeletonToDepthImage(Microsoft.Research.Kinect.Nui.Vector, out float, out float) Microsoft.Research.Kinect.Nui.Camera.GetColorPixelCoordinatesFromDepthPixel(Microsoft.Research.Kinect.Nui.ImageResolution, Microsoft.Research.Kinect.Nui.ImageViewArea, int, int, short, out int, out int) .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000;...

Read More »

nykozoom

We have a decent sized play area for our Kinect but do find with 2 players we need to shift a bit of furniture and can get a bit dangerous when the person you’re playing against is 6’4” and has a really long arm span in some of the games. When we’re playing with the KinectSDK we often want to get a bit closer to the kinect for some of our tests than what it allows at the moment.

Decided to buy a Nyko Zoom and see what effect it had. I’d seen the ads for them and have been keen to see how much putting a lense over the Kinect messes with the optics/sizes etc. EBGames are selling them in store at the moment for $40. It’s really easy to mount to the Kinect and even comes with a protective bit of plastic if you’re planning on taking the lense on and off a bit. It slots on well and easy to tell if you’ve put it in the right spot.

Zoom with XBox and Kinect First I tried it on our Kinect we use on our XBox with the classic “Kinect Adventures”. I found at the borders of the 2 zone space I got about 30cm extra I could come forward and to each side. While it’s not a massive improvement, it does mean we’re well clear of the furniture when we need to stretch from front to back and should give me an extra bit of room when I play any of the games against someone tall.

In the one player zone space I found I could get quite a bit further forward but I...

Read More »

Since the update to Beta2 of the Kinect for Windows SDK all our Kinect samples are out of date so I thought I’d update them to the latest and greatest and post them all here.

kinectcode1

To begin with I want a nice clean framework that is both easy for the first time Kinect coder to understand but also makes use of the new abilities of the Kinect SDK. What I’ve come up with achieves the following 3 goals:

Support all combinations of Kinects be attached/detached/powered off/multiple. Exposes a single Kinect Runtime as a property called Nui (It is null if there isn’t a Kinect attached). Obvious location to wire up event model (and remove events if Kinect is removed) This is meant to be a good place to start with simple examples with all the code clear in the one file.

public partial class MainWindow : Window { private Runtime nui; public Runtime Nui { get { return nui; } set { if (nui != null) { //dispose all events and unintialise nui.Uninitialize(); } nui = value; if (nui != null) { //wire up events and initialise } } } public MainWindow() { InitializeComponent(); Closed += WindowClosed; Loaded += WindowLoaded; }...

Read More »

ANU1John and I were invited to help out with the HCI Summer School at ANU to get the students started with the KinectSDK for Windows. In the morning Henry Gardner opened the Summer School quickly followed by a look at some of the Kinect Innovations that have been happening by one of the staff from CSIRO.

We put together what we titled a KinectSDK “Fun Day”. John and I gave a couple of talks to give the students an introduction to the Kinect SDK. The “naked Kinect”, my gesture demo and John’s depth camera demonstrations proved popular with the audience again. Just before lunch we helped break up the group into smaller groups of 3 or 4 so they could share around the 12 kinects in the labs. KinectSDK is great for collaboration between team members as they have to literally get out of their seats to test their ideas so is ideal for working in groups.

ANU3

ANU4

...

Read More »

Copyright © 2002-2013 Soul Solutions Pty Ltd. | Login