This project is read-only.

Project Description
Demo of Kinect SDK Beta 2 features for 2011 Christmas

More information on http://elbruno.com/2011/12/28/kinect-merry-christmas-with-kinect-and-visual-studio-2010-gift-of-the-valentino/

Hi,

in these days of festivities, when you join the side 2 dwarves wanting to play, you got the kinect connected to the PC and the SDK that you strange, at the very least you get is something like the following:

image

An application for every person that appears on WebCam puts a Santa Claus Cap!!!!


As well, after several post about Kinect, today the challenge was as follows

  1. identify the specific joint of the head of each skeleton
  2. calculate the relative coordinates of that joint before an image of the webcam
  3. paint a Santa Hat on webcam

The first point is easily solved once we iteramos by the skeletons recognized in mode Trackeable (lines 6 to 9), we can iterate between the Joints of the skeleton and verify that it is the head compared with [JointID.Head] (line 17).

Once identified the head Joint we come to the 2nd point which is a bit more complicated. Function GetDisplayPosition() (line 27) is in charge for the conversion of the position of the Joint to relative location in the image. The following capabilities of the SDK are used to this

SkeletonEngine.SkeletonToDepthImage () using this function we can know the relative location in “depth” of a joint.

NuiCamera.GetColorPixelCoordinatesFromDepthPixel () using this function, we can discover the position at coordinates x/Y from the depth we obtained earlier.

In both cases, it must make some adjustments on the one hand the webcam image is 640 * 480 resolution and depth capacity is only 320 * 240. But hey, with these few lines already we can define the specific location of our head and paint a SantaHat therein.

Last edited Dec 28, 2011 at 10:20 AM by elbruno, version 3