[# KINECT] Changes in # KinectSdk from Beta 2 to SDK V1.0 (I)



before that I remain obsolete and while I still participate in the MVP Summit 2012 but virtually come with some of the changes that we have to take into account if we have applications for Kinect to use the Kinect SDK Beta 2 and thought of migrating to Kinect SDK V1.0.


Initially we had a reference to Microsoft.Research.Kinect


With the new SDK must resolve the invalid reference and add a new one to Microsoft. Kinect .


Sensor initialization

When we used the Beta 2, we had to define the initialization of the sensor using the Initalize() method and at the same time passed you a series of parameters to initialize camera, depth sensor and detection of skeletons.

   1: void InitKinect()

   2: {

   3:     if (Runtime.Kinects.Count == 0)

   4:         return;

   5:     kinect = Runtime.Kinects[0];

   6:     RuntimeOptions = RuntimeOptions.UseDepthAndPlayerIndex | 

   7:         RuntimeOptions.UseSkeletalTracking | 

   8:         RuntimeOptions.UseColor;

   9:     kinect.Initialize(RuntimeOptions);

  10:     kinect.DepthStream.Open(ImageStreamType.Depth, 2, ImageResolution.Resolution320x240,

  11:         RuntimeOptions.HasFlag(RuntimeOptions.UseDepthAndPlayerIndex) || 

  12:         RuntimeOptions.HasFlag(RuntimeOptions.UseSkeletalTracking) ? 

  13:         ImageType.DepthAndPlayerIndex : ImageType.Depth);

  14:     kinect.DepthFrameReady += this.KinectDepthFrameReady;

  15: }

With SDK V1.0 this is much simpler. I believe that the following code, where only Initializes the depth sensor, is declarative enough as to who understand that the important thing is now in line 6.

   1: void MainWindowLoaded(object sender, RoutedEventArgs e)

   2: {

   3:     if (KinectSensor.KinectSensors.Count == 0)

   4:         return;

   5:     this.kinectSensor = KinectSensor.KinectSensors[0];

   6:     this.kinectSensor.DepthStream.Enable();

   7:     this.kinectSensor.Start();

   8:     this.kinectSensor.DepthFrameReady += this.KinectSensorDepthFrameReady;

   9: }


If we wanted as well as the depth sensor to activate the camera stream and also the recognition of skeletons, the following code is that we have to use. The lines  6, 7 and 8 are the important ones.

   1: void MainWindowLoaded(object sender, RoutedEventArgs e)

   2: {

   3:     if (KinectSensor.KinectSensors.Count == 0)

   4:         return;

   5:     this.kinectSensor = KinectSensor.KinectSensors[0];

   6:     this.kinectSensor.ColorStream.Enable();

   7:     this.kinectSensor.SkeletonStream.Enable();

   8:     this.kinectSensor.DepthStream.Enable();

   9:     this.kinectSensor.Start();

  10:     this.kinectSensor.DepthFrameReady += this.KinectSensorDepthFrameReady;

  11: }


In coming posts other examples about some changes from Beta 2 to the Final SDK.

Greetings @ Home

El Bruno

Download: http://www.microsoft.com/en-us/kinectforwindows/develop/overview.aspx

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s