Getting a Kinect Working With Processing on a Mac

About: I spend my time somewhere between engineering and art.

The first generation of the Microsoft Kinect for the Xbox 360 might be getting old as technology but for approximately $100 (used units can be found for ~$30), there is no better tool for doing a full body, interactive experience (for now...).

The history behind how Kinect was "hacked" is a worthwhile read. After access to the Kinect's capabilities was opened up, there was a huge explosion of projects that revolved around the Kinect. Historically, I wouldn't be surprised if it is considered a monument for technology. It was the first time that the type of technology that the Kinect provides became inexpensive enough to justify buying, had a resolution that was useable, and was accessible through free and open source software. I give mad props to Adafruit and Johnny Lee for what they did. 

Anyways, before you can use the Kinect with Processing, you'll need to install a library for Processing. There are a few library options but the universal favorite is OpenNI

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Materials!

In addition to your computer (for consistency, I'm just going to assume you have a Mac), you'll need a:

Microsoft Kinect
Kinect power cord

The power cord connects to the Kinect's cord and also has a USB connection for your computer. 

Step 2: Download the Library

If you haven't already, you'll need to download and install Processing

The library for Processing is Simple OpenNI. The two files that you will need to download from this site are:

SimpleOpenNI-0.27.zip
OpenNI_NITE_Installer-OSX-0.24.zip

The names of these files might have different numbers listed but don't worry about that, just make sure that you download Simple OpenNI and the NITE Installer for OSX. It will download as a zip file, which needs to be extracted before you can do anything with it. Opening up the zip files will automatically extract them and create a new file with the same name, in the same location. 

Move these new files (OpenNI_NITE_Installer_OSX & SimpleOpenNI) to your desktop. This will make it easier for dealing with Terminal.

Step 3: Installing NITE Using Terminal

There's a lot of misconceptions over terminal. People see the command line and they immediately assume that they are going to break everything. You potentially can break everything with terminal but it's kind of hard to do. If you type in something that terminal doesn't understand, it will spit back an error at you. 

Just follow along and you will be fine.

Search for terminal in spotlight and open it up. You'll get a screen that will have one line that will list your computer name followed by your user name. There are two important commands that we will be using to install NITE, cd & ls. To start, type in ls (it is a shortened command for list directory contents) into terminal and press return. It will list the folders that are found in that location. You'll see the same exact same folders if you go to your home folder. 

You should see Desktop listed after you've done the ls command. 

The next command you'll need is cd which stands for change directory. We need to go into the desktop folder and we do that by typing

cd Desktop

and press return. We are now in the Desktop folder. Type in ls again to list the folders found in Desktop. One of these files should be OpenNI_NITE_Installer-OSX. Go into this folder with

cd ./OpenNI_NITE_Installer-OSX

Type in ls to see what is in this folder. You should see a file called install.sh. Type in

sudo ./install.sh

and press return. It will ask for your password. Type it in and press return. When you are typing in your password, it will look like you aren't typing anything. Don't worry about it, it is being typed in. It should automatically install the files. After it is completed, you can close terminal. The sudo command is used to gain super user status. It overrides your computer best instincts and does what you tell it. In this case, we are just telling your computer to install software. 

If for some reason this method doesn't work for you computer, you will have to follow the directions under "Install OpenNI the official way"


Step 4: Move the SimpleOpenNI Folder to Your Processing Libraries Folder

The final step is to move the SimpleOpenNI folder that is on your desktop to your Processing libraries folder. This folder should be located in your sketchbook folder (where you save your code). If you don't know where this is, open up Processing and go to 

Processing => Preferences

and the sketchbook location is listed at the top. 

Go to this folder location. In it you should see a folder called libraries. If it isn't there, don't worry, you just have to make a new folder in that location and name it libraries

Move the SimpleOpenNI folder into this folder. If Processing is open, fully close out of it. 

Step 5: Test It Out!



Open up again Processing and try it out! A lot of projects use the skeleton feature to register a person and the location of their limbs. An example of this feature is found in

File => Examples => Contributed Libraries => SimpleOpenNI => OpenNI => User3d

There are a lot different sketches in the examples folder that show what you can do with OpenNI and the Kinect. Try them out and get inspired!

Be the First to Share

    Recommendations

    • CNC Contest

      CNC Contest
    • Make it Move

      Make it Move
    • Teacher Contest

      Teacher Contest

    Discussions