- Posted: May 07, 2013 at 6:00 AM
- 5,082 Views
This is why I love development and developers... Do it once, okay. Twice, maybe, Three times? Okay, need to stream line it.
Marcus has provided a great example of streamlining Kinect for Windows SDK development. It's simple, yet, when you see it, you'll know you want to grab this... (plus you've got to love that he's released the source too)
Since I have been playing around with the Kinect for Windows SDK I’ve created a lot of little new projects and samples to try things out. Starting point was always something like this:
Because I most often use the 640×480 option anyway, the format is an optional parameter when enabling the streams and it defaults to *640x480Fps30.
I’ve extracted the two little lines that gets the first connected Kinect Sensor to a class called KinectConnector. At the moment an exception is thrown when no Kinect unit is connected. This is not a very good way of handling this scenario and will be changed in the future.
Now the code is even cleaner:var sensor = KinectConnector.GetKinect() .EnableColorStream() .EnableSkeletonStream() .EnableDepthStream() .Seated() .NearMode() .Start();
For an even shorter and quicker Setup I’ve implemented the method ‘KickStart’ which enables the three streams and calls Start() on the KinectSensor object.
For future ‘try out samples’ I’ll just have to code this now:var sensor = KinectConnector.GetKinect() .KickStart();
Project Information URL: http://passiondev.wordpress.com/2013/05/03/fluent-kinect/
Project Download URL: FluentKinect
Project Source URL: FluentKinect