Managing your Kinect with Rob Miles' Kinect Manager

Since we last highlighted Rob Miles' work in  the The Purple Book... "Using Kinect for Windows with XNA" post, he's been a busy guy working on another book for the Kinect. And in his spare time, he's provided us a peek some of the code from the book...

Kinect Manager available for download

Today I finished all the chapters for my upcoming book about the Kinect SDK. As part of the book I’ve made a wrapper class that makes it a little easier to use the classes in the Kinect for Windows SDK. You can use it to start a Kinect running and then bind to events that driver generates when new frames are available. The frame events are processed on a “round robin” basis so that the driver will not get new data from the sensor until it has been processed by your application. This makes it work well even on low performance machines that might not be able to keep up with the events generated by the Kinect sensor. The manager also generates status messages.

You can download the class, along with a program that demonstrates it, from here. For it to work you must have installed the Kinect for Windows SDK from here. And of course you’ll need a Kinect sensor – either the Xbox 360 one or the Windows one will work fine.

Project Information URL: http://www.robmiles.com/journal/2012/4/22/kinect-manager-available-for-download.html

Project Source URL: http://www.robmiles.com/files/KinectMgrDemo.zip

image

image

void setupKinect()
{
     try
     {


         myKinectMgr = new KinectManager(0);
         myKinect = myKinectMgr.Kinect;

         myKinectMgr.DoProcessSkeletons +=
             new KinectManager.ProcessSkeletons(processSkeletonFrame);

         myKinectMgr.DoProcessDepthFrame +=
             new KinectManager.ProcessDepthFrame(processDepthFrame);

         myKinectMgr.DoProcessVideoFrame +=
             new KinectManager.ProcessVideoFrame(processVideoFrame);

         myKinectMgr.DoStatusChanged +=
             new KinectManager.StatusChanged(updateStatus);

         myKinectMgr.Start();
     }
     catch
     {
         MessageBox.Show("Kinect initialise failed", "Kinect Demo");
         Application.Current.Shutdown();
     }
}
 

SNAGHTMLf6b4f58

SNAGHTMLf6b66dd

Contact Information:

Tags:

Follow the Discussion

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.