First look: Kinect for Windows v2 Developer Preview SDK
Longtime readers know that I have great enthusiasm for the Kinect sensor as a revolutionary NUI technology. Now I can report that I was accepted to the Developer Preview program, and my new Kinect for Windows sensor arrived today.
The packaging goes out of its way to make you feel special: when the box opens, the first thing you see is a panel that reads “Developer Preview” under the K4W logo. Beneath that is a panel of K4W stickers.
Unpacking the Kinect for Windows v2 sensor.
The sensor itself comes with a couple of snazzy decals.
The Kinect for Windows v2 sensor, with snazzy decals.
Also, the Developer Preview SDK shipped last week, so I took the whole package for a spin.
There are five sample apps with native (C++/Direct2D) and managed (C#/XAML) solutions:
- BodyBasics-WPF.exe / BodyBasics-D2D.exe
- ColorBasics-WPF.exe / ColorBasics-D2D.exe
- CoordinateMappingBasics-WPF.exe / CoordinateMappingBasics-D2D.exe
- DepthBasics-WPF.exe / DepthBasics-D2D.exe
- InfraredBasics-WPF.exe / InfraredBasics-D2D.exe
Unfortunately, we don’t get any Windows Store app demos – all of the included demos run on the desktop only.
After hooking up everything, including the charmingly prototypical router box, I ran the BodyBasics demo. And nothing happened. Hmm.
The router box that supplies power and connects the sensor to the computer through USB3.0.
I checked the cables and scrutinized the very bright LEDs (blue means the sensor is connected to computer, apparently). Installed the drivers on a different computer, got the same result.
So I consulted the online docs and found out that the KinectService needs to be running. This lives in the C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Kinect for Windows SDK v2.0 folder. D’oh.
With that little bump overcome, the demo apps run fine.
Screenshot of the BodyBasics-WPF demo application in the Kinect for Windows v2 SDK.
Screenshot of the ColorBasics-WPF demo application in the Kinect for Windows v2 SDK.
Screenshot of the CoordinateMappingBasics-WPF demo application in the Kinect for Windows v2 SDK.
Screenshot of the DepthBasics-WPF demo application in the Kinect for Windows v2 SDK.
Selfie taken with the InfraredBasics-WPF demo application in the Kinect for Windows v2 SDK.
The inside of the Kinect for Windows v2 shipping box, as seen by the Kinect sensor's infrared camera.
In Visual Studio 2013, all of the sample code builds without a hitch. The API seems well designed. For example, here’s how to get the body models in C#:
Initialize body models
- // for Alpha, one sensor is supported
- this.kinectSensor = KinectSensor.Default;
- if (this.kinectSensor != null)
- {
- // get the coordinate mapper
- this.coordinateMapper = this.kinectSensor.CoordinateMapper;
- // open the sensor
- this.kinectSensor.Open();
- // get the depth (display) extents
- FrameDescription frameDescription = this.kinectSensor.DepthFrameSource.FrameDescription;
- this.displayWidth = frameDescription.Width;
- this.displayHeight = frameDescription.Width;
- this.bodies = new Body[this.kinectSensor.BodyFrameSource.BodyCount];
- // open the reader for the body frames
- this.reader = this.kinectSensor.BodyFrameSource.OpenReader();
- // set the status text
- this.StatusText = Properties.Resources.InitializingStatusTextFormat;
- }
- else
- {
- // on failure, set the status text
- this.StatusText = Properties.Resources.NoSensorStatusText;
- }
Easy peasy. The Microsoft.Kinect namespace has everything you need to interact with the sensor at a high level of abstraction. The classes in the Microsoft.Kinect.dll assembly, extracted by using Ildasm, are appended below.
With this preview of the new SDK, I’m more convinced than ever that Kinect is going to revolutionize NUI. I hope that someday soon this hardware will be miniaturized and built into every laptop and slate.
Classes in the Developer Preview version of Microsoft.Kinect.dll.
// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.33440
// Copyright (c) Microsoft Corporation. All rights reserved.
// warning : THIS IS A PARTIAL DISASSEMBLY, NOT SUITABLE FOR RE-ASSEMBLING
KinectExceptionHelper
CameraSpacePoint
ColorSpacePoint
DepthSpacePoint
Vector4
Joint
JointOrientation
BaseBodyDataCollection`2
ExpressionDetectionResultCollection
JointCollection
JointOrientationCollection
ActivityDetectionResultCollection
AppearanceDetectionResultCollection
FrameDescription
Body
ColorCameraSettings
IsAvailableChangedEventArgs
FrameCapturedEventArgs
CoordinateMappingChangedEventArgs
CoordinateMapper
CoordinateMapper_CoordinateMappingChanged_EventHandler
AudioSource
BodyFrame
BodyFrameReference
BodyFrameArrivedEventArgs
BodyFrameReader
BodyFrameReader_PropertyChanged_EventHandler
BodyFrameReader_FrameArrived_EventHandler
BodyFrameSource
BodyFrameSource_FrameCaptured_EventHandler
BodyIndexFrame
BodyIndexFrameReference
BodyIndexFrameArrivedEventArgs
BodyIndexFrameReader
BodyIndexFrameReader_PropertyChanged_EventHandler
BodyIndexFrameReader_FrameArrived_EventHandler
BodyIndexFrameSource
BodyIndexFrameSource_FrameCaptured_EventHandler
ColorFrame
ColorFrameReference
ColorFrameArrivedEventArgs
ColorFrameReader
ColorFrameReader_PropertyChanged_EventHandler
ColorFrameReader_FrameArrived_EventHandler
ColorFrameSource
ColorFrameSource_FrameCaptured_EventHandler
DepthFrame
DepthFrameReference
DepthFrameArrivedEventArgs
DepthFrameReader
DepthFrameReader_PropertyChanged_EventHandler
DepthFrameReader_FrameArrived_EventHandler
DepthFrameSource
DepthFrameSource_FrameCaptured_EventHandler
InfraredFrame
InfraredFrameReference
InfraredFrameArrivedEventArgs
InfraredFrameReader
InfraredFrameReader_PropertyChanged_EventHandler
InfraredFrameReader_FrameArrived_EventHandler
InfraredFrameSource
InfraredFrameSource_FrameCaptured_EventHandler
LongExposureInfraredFrame
LongExposureInfraredFrameReference
LongExposureInfraredFrameArrivedEventArgs
LongExposureInfraredFrameReader
LongExposureInfraredFrameReader_PropertyChanged_EventHandler
LongExposureInfraredFrameReader_FrameArrived_EventHandler
LongExposureInfraredFrameSource
LongExposureInfraredFrameSource_FrameCaptured_EventHandler
MultiSourceFrameArrivedEventArgs
MultiSourceFrameReader
MultiSourceFrameReader_PropertyChanged_EventHandler
MultiSourceFrameReader_MultiSourceFrameArrived_EventHandler
KinectSensor
KinectSensor_PropertyChanged_EventHandler
KinectSensor_IsAvailableChanged_EventHandler
MultiSourceFrame
MultiSourceFrameReference
_KinectStatus
_FrameSourceTypes
_ColorImageFormat
_HandState
_DetectionResult
_TrackingConfidence
_TrackingState
_FrameCapturedStatus
Activity
Appearance
AudioBeamMode
ColorImageFormat
DetectionResult
Expression
FrameCapturedStatus
FrameEdges
FrameSourceTypes
HandState
JointType
KinectCapabilities
KinectStatus
TrackingConfidence
TrackingState
IBody
IFrameDescription
IColorCameraSettings
IIsAvailableChangedEventArgs
IFrameCapturedEventArgs
ICoordinateMappingChangedEventArgs
ICoordinateMapper
IBodyFrame
IBodyFrameReference
IBodyFrameArrivedEventArgs
IBodyFrameReader
IBodyFrameSource
IBodyIndexFrame
IBodyIndexFrameReference
IBodyIndexFrameArrivedEventArgs
IBodyIndexFrameReader
IBodyIndexFrameSource
IColorFrame
IColorFrameReference
IColorFrameArrivedEventArgs
IColorFrameReader
IColorFrameSource
IDepthFrame
IDepthFrameReference
IDepthFrameArrivedEventArgs
IDepthFrameReader
IDepthFrameSource
IInfraredFrame
IInfraredFrameReference
IInfraredFrameArrivedEventArgs
IInfraredFrameReader
IInfraredFrameSource
ILongExposureInfraredFrame
ILongExposureInfraredFrameReference
ILongExposureInfraredFrameArrivedEventArgs
ILongExposureInfraredFrameReader
ILongExposureInfraredFrameSource
IMultiSourceFrameArrivedEventArgs
IMultiSourceFrameReader
IKinectSensor
IMultiSourceFrame
IMultiSourceFrameReference
IEnumKinectSensor
IKinectSensorCollection
Technorati Tags: Windows,Windows programming,Kinect,C#,XAML,Direct2D
Comments
Anonymous
December 02, 2013
Very nice! How is the individual finger tracking? Do the fingers have orientation? Can you detect a fist versus open hands? Is it detailed enough to detect sign language, do you think?Anonymous
February 11, 2014
thank you so much! I do as you said. but I can't run kinectService. when i run KinectService in cmd: Ctrl+C to exit. ConnectionManager - DeviceNotification VVTechs SwitchVersion failed 0x80070057 ConnectionManager - DeviceNotification ConnectionManager::_OnDeviceStatus - Connected can you help me! thank you very muchAnonymous
February 12, 2014
Thank you. We just received the Kinect v2 sensor and now we need to access to the new SDK and API documentation. Where can we download it?Anonymous
February 19, 2014
I have the same questionAnonymous
March 25, 2014
I also got "VVTechs SwitchVersion failed 0x80070057" error. Camera is detected in Kinect but not depth sensor.Anonymous
March 28, 2014
Anybody got the solution for the "VVTechs SwitchVersion failed 0x80070057" error?Anonymous
March 30, 2014
Hi everybody, if you have specific questions that need answering, check out the Kinect for Windows SDK forum: social.msdn.microsoft.com/.../home.Anonymous
April 12, 2014
I got "VVTechs SwitchVersion failed 0x80070057" in Intel 3000 graphics which was not compatible with kinect v2.Anonymous
May 15, 2014
Thank you, my version(v4.0.30319) of Microsoft.Kinect.dll, not contains? Body ColorFrame InfraredFrame Body MultiSourceFrameReader ... What I Do?Anonymous
May 22, 2014
The comment has been removedAnonymous
July 29, 2014
I am getting APPCRASH for DepthBasics-D2D.exe when connecting to KinectStudio. Could you please resolve this problem, I have to start my project by getting depth info from Kinect Studio.