How to Hack Your Kinect

When the Kinect first launched last November, gamers were (to put it charitably) a bit skeptical. Here was a device with incredible technological potential, and the most impressive game that came out with it was a dance simulator.

Still, the Kinect has become a bona fide hit, selling more than eight million units in the first 60 days alone and being named the “fastest-selling consumer electronics device” of all time by Guinness World Records. But more importantly, the software problem has been solved. Not by Microsoft, whose Kinect releases have been few and far between, but by the ever-growing legion of hackers creating innovative tech demos and applications for Kinect on the PC.

If you have a Kinect, you owe it to yourself to see what’s happening in the hacking scene—putting this knowledge to use isn’t even that hard. Follow along and we’ll show you how.

1. Set Up Your Kinect

Physically setting up the Kinect is a piece of cake, as long as you have the stand-alone power supply that comes with the boxed version of the Kinect. If you do, just plug in the power supply, connect it to the Kinect, and then run the USB cable over to the PC (don’t plug it in just yet, though).
Unfortunately, if you bought the bundle that includes an Xbox 360 S and the Kinect together, that doesn’t come with a power supply. If you want to use your Kinect with a PC you’ll have to order a stand-alone power supply (above) from Microsoft

2. Install PrimeSense OpenNI and Sensor Kinect

With the Kinect physically ready to go the plan gets a bit more complicated. You’re going to need to install a total of three things on your system before you can start running software for the Kinect on your PC—one driver, and two pieces of middleware.

Normally, in a situation like this we would want to start with the lowest-level piece of software, the driver. However, in this case, the driver (Sensor Kinect) won’t install without the first piece of middleware (OpenNI), so we’ll start there.

But first, why do we need middleware? Early Kinect hacks relied entirely on rough-around-the-edges drivers that could extract the raw images and depth maps captured by the Kinect sensor. People were able to make some cool hacks using those data streams, but you had to be familiar with image-processing programming in order to do much of anything. OpenNI, from PrimeSense (the Israeli Company that Microsoft licensed the Kinect Technology from in the first place), is middleware that allows developers easier, more abstracted access to sensor data, without having to do the low-level stuff themselves. It’s hardware-agnostic, so OpenNI software will work with any sensor device that has an OpenNI driver written for it. As it stands, Kinect is the only such sensor.

To install OpenNI, and scroll down until you see the link to download the latest unstable build for Windows. Download and run the installer—there shouldn’t be any surprises here.

With OpenNI installed, you can now use the Sensor Kinect driver. Go to the Sensor Kinect and click the Downloads button, then click the Download .zip button under Download Source. You won’t have to actually compile any source code, though—just extract the contents of the .zip file and navigate to the Bin/ directory, which contains a binary Windows installer. Run through the quick installer and you’ll be good to go.

At this point, you can plug your Kinect into the computer and perform some quick tests to make sure everything’s on track. First, when you plug in the Kinect, your computer should recognize it for what it is. If you go to the Device Manager, you’ll see a PrimeSensor category that includes a Kinect Motor and Kinect Camera device (below).
OpenNI needs to be configured to run properly, which is handled with a set of XML files in the OpenNI/Data directory. Fortunately, the Sensor Kinect .zip file contains some preconfigured files for you to use. Go back to the directory you extracted the Sensor Kinect source code to, and find the OpenNI folder. Copy the contents of this folder to the Program Files\OpenNI\Data folder.

Finally, open the .xml file you just copied over, because we have to make one more change. In the beginning, there’s a section that reads:

<Licenses>
<!-- Add licenses here
<License vendor=”vendor” key=”key”/>
-->
</Licenses>
Change this section so that it reads like this:
<Licenses>
<License vendor=”PrimeSense” key=”0KOIk2JeIBYClPWVnMoRKn5cdY4=”/>
</Licenses>

Don’t worry, it isn’t piracy—this license key is provided by PrimeSense to the community.
Finally, we can run a software test to make sure everything’s working. Go to the folder you installed OpenNI to, then navigate to Samples\Bin\Release and find the file niviewer.exe. When you run this program, you should see a video stream side-by-side with a single-color depth map (above). If you do, you’re more than halfway done.

3. Install NITE

NITE is another component of the overall PrimeSense package. It’s the higher-level middleware, which interprets the raw sensor data and translates it into more useful constructs—isolating gestures and identifying where your body is. These tools are used by many of the developers creating software for Kinect today.

You can download the latest version of NITE  The installation is pretty much the same as with OpenNI, except that partway through, you’ll be asked for a license key. Again, use “0KOIk2JeIBYClPWVnMoRKn5cdY4=”.
Once you’ve installed NITE, you’ll have to run through basically the same configuration process as with OpenNI. Go to the Sensor Kinect source directory, find the directory labeled NITE, and copy its contents into the Program Files\Prime Sense\NITE\Data directory. Open each XML file in Notepad, and insert the license key where needed (above).

You can find NITE sample programs in the NITE\Samples\Bin\Release directory. A good one to start with is Sample-Players.exe, which simply shows you a video feed of what the camera sees, with each human it sees shaded in a different color (below).

4. Install Software

Congratulations! You’ve hacked your Kinect! Enjoy those Kinect sample applications that came with NITE. 
kindly comment for any suggestions and queries
#kinect #hack #microsoft #gesture #motion sensing # gesture recognition #infizeal

Comments

Popular posts from this blog

How to hack your xbox 360 completely

Autonomous mobile additive manufacturing robot runs circles around traditional 3D printers

The power of Bluetooth 4.0