Reinvent The Wheel

Round is nice, but we can do better!

TKinect for Delphi

| 9 Comments

UPDATE:

Since I originally wrote this post, TKinect has been made publicly available. Further-more, Embarcadero Technologies (the makers of Delphi) have sponsored the project by providing me with a Kinect controller with which to test and further develop the component.


Given that a friend of mine has spent the last several months preaching to me about how awesome the Kinect (project Natal) controller for the Xbox 360 is, and how he wants to be able to use it with some of his Delphi programs on a PC, I decided I’d take a look and see what I can do.

First and foremost I had to find out if a Windows driver for the device has been produced (obviously not by Microsoft since they want you to wait for and buy Windows 8 which includes the drivers). Thankfully (as many of you may have already read) a hacker wrote a successful (open source) Kinect driver for Linux. Since then, this driver has been reproduced for those of us using Windows 7 (I must stress I have no idea personally if the driver is available for older versions of Windows) and, better yet, this driver is freely available for download. Even better news is that a group has produced a simple SDK to communicate with one or more Kinect devices, which is also freely available to download.

Can you see where this is going? Of course you can!

Having procured the necessary driver and the aforementioned SDK, I set about translating the C headers over to Delphi/Pascal. This process took literally minutes, as the SDK has only 18 functions (as of December 11th 2010, and excluding an interface to the Kinect’s audio functionality, amongst other things) and so this stage has already been completed.

The original intent had been to simply release the very basic Delphi wrapper for those 18 functions, and call it a day. However, those of you who know me well enough will know that I’m not one to simply release a wrapper of anothers’ work without adding something of my own (and of equal or, dare I say, greater value) to sweeten the deal. For those who knew that, it should come as no surprise to you that I haven’t left it there… in fact I have produced the first stages of TKinect, a TComponent based Delphi object to quickly (and easily) integrate the functionality of one or more Kinect controllers directly into your native Delphi applications.

At this point I’d like to mention the twist in this little endeavor: I do not own a Kinect controller! I have written all of this source code, yet lack any means of testing it. That is where you, hopefully well-equipped reader, come in!
Your mission, should you choose to accept it, is to download TKinect (as well as all required third-party software) and test it, for me, for yourself, and for the rest of the Delphi development community.

Shortly (or shortly after having posted this blog entry, for those reading from the “future”) I shall (have, for future readers) release(d) my TKinect component, it’s Delphi 2010 package (note, TKinect should work with every version of Delphi going right back to Delphi 7, possibly even earlier, and possibly also Lazarus/FreePascal though none of the aforementioned have been tested by myself) and (fingers-crossed) one or two simple (equally untested) demo applications.

TKinect will be (“is now”, for future readers) available for you to download both here on my Blog, as well as through my public SVN.

I seriously appreciate any feedback; in-particular error/bug reports, and, of course, success stories. You can provide such feedback by leaving a comment here on this blog entry, or on the TKinect page also here on my blog.

Want to help take this effort further?

As I mentioned before, I currently (“at the time of writing” for future readers) don’t (“didn’t“) have a Kinect Controller! You can help me with that! At the time of writing, Amazon.co.uk are selling Kinect controllers for £127. Anyone who is interested in furthering the development of TKinect is encouraged to send me a donation to help raise that figure (which, in the grand scheme of things, isn’t an awful lot to aim for). You need only look around my blog here to see that I spearhead many open source Delphi projects, and have never asked for anything in return. Your donation would be greatly appreciated not just by myself, but by all of your other Delphi development peers using or interested in any of my Delphi development projects.

You can send donations through PayPal to Kraven [a.t.] RustyBin [d:o:t] com (garbled so as to help prevent automated spam). Any donation amount equal to or exceeding £5 will invite a special mention in the TKinect source, web pages, along with all sample/test/demo applications I produce containing it, and also including a link to a URL of your choice (so long as said URL is not related to inappropriate materials, illegal content, scams/phishing or other undesirable web content… of course)

To those who choose to donate, thank you in advance.

To all of you interested in checking out TKinect, thank you for your interest, as always.

Follow me on Twitter (@LaKraven) to stay informed on the development of TKinect, along with all of my other Delphi development projects, lessons, and other computer/programming-related topics.

Author: Simon Stuart

Automation and Productivity Systems Specialist, Author of various Components, Libraries and Tools for Embarcadero Delphi, Embarcadero Technology Partner, Founder and CEO of LaKraven Studios Ltd, Father of 2 (+ 2 dogs), Credited Technical Editor, Seeker of peace!

9 Comments

  1. Pingback: Amazing demo of TKinect component for Delphi | Andreano Lanusse Blog

  2. Pingback: Demonstração sensacional do uso do componente TKinect para Delphi | Andreano Lanusse Blog

  3. Simon, you did a very good job and now with Alexs’s video the world can see the results

    Great job.

    Andreano Lanusse

  4. Sorry, brain not fully in gear. I sent it in euros instead of GBP, so the # is gonna look a little funky in the conversion.

    Looks great so far. When MS releases PC drivers, I would discourage you in adopting/switching over to them – Microsoft has THE WORST PC hardware support on the market. I’m surprised some of their hardware hasn’t had support dropped even before it ever gets released. (thankfully keyboards do not need drivers. I love my natural keyboard!)

    • Appreciate the donation very much…
      Indeed, when M$ does release “official” drivers, I will provide compatibility in TKinect, but it will be a configurable option in the .INC file!

  5. Hello Simon,
    there was an interesting post on slahdot considering “Real-Time Human Pose Recognition in Parts from Single Depth Images” …
    This is how “Microsoft Research Cambridge & Xbox Incubation” is solving the problem.
    Do you know if this algorithms will be part of the Kinect SDK and will TKinect wrap them up?

    Best regards

    Roland

    • Roland,
      I can’t speak for the SDK at this moment in time… but with enough understanding of the algorithm it would certainly be possible to implement it as part of TKinect’s motion tracking subsystem.
      At this moment I’m hesitant to commit my time to further development of the TKinect component itself. This is because I’m waiting for Microsoft to release their official drivers! Not much point in investing countless man-hours into developing TKinect if I’m going to have to make large-scale changes a month from now… the more I implement, the more difficult it will be to adapt it for the official drivers later.

      In the mean-time, I’m taking the raw Depth data, and attempting to perfect various tracking algorithms (poses as well as hand and full body gesture etc.) This way, once the official drivers are released, it should be fairly simple to implement these functional aspects of the code.

Leave a Reply

Required fields are marked *.

*


*