Within days of the Microsoft Kinect’s release, a set of open-source drivers surfaced letting people hack it to work with devices other than the Xbox 360. PC and Linux hacks appeared almost instantly. Now an independent developer by the name of Theo Watson has adapted an existing library to enable the Kinect to work with Mac OS X.
Watson calls the project a work-in-progress, which uses the open-source libfreenect by Hector Martin, a work-in-progress, but it does appear to be working just fine. The image in the video flickers a little bit, so a bit more USB optimization is in order. He said on a hosted vimeo page that most of the code remains unchanged, but some tweaks to libusb and transfer sizes were necessary to get the Kinect up and running. The latest update at the time of this writing works with OS X 10.6.3—two down from the latest revision—and includes several bug fixes.
- Jul 02, 2019 I have been trying the linux install instructions on macOS. It seems that most steps in CMake work, but the DepthEngine is Windows/Nix only. Would be amazing if you could release the DepthEngine for macOS. The rest should be achievable by the community / via Pull Request etc. A huge number of our community ( openFrameworks ) would make good use of macOS support.
- Easy 3D Scanning for 3D Printing Mac & PC at Techshop or Online With Xbox Kinect: Made At TechShop. Do you have an Xbox kinect laying around? Well get ready because today's your lucky 3D printing Day! Goal: To Make a 3D scan of a person for easy printing at Techshop. I am going to demonstrate using a free version of Skanect.
As you may know it, Kinect is a product manufactured by Microsoft. This leads to a lack of support for other operating systems like Linux or MacOS. But don't worry there are solutions. You first need to check the main prerequisite: - your computer. Installing Greenfoot/Kinect on Mac OS X. MacPorts allows you to easily install the bits of open source software necessary for OpenNI and the Greenfoot KinectServer. Install Prerequisite Libraries. Issue these commands in a Terminal to install various required libraries.
Anyone with the skills who wants to have a go at the source code can grab it from the vimeo page. To get it working, Watson recommends trying both available USB ports, and making sure that too many devices aren’t plugged in. Hey, it’s a work in progress; give it some credit.
Over the weekend, Google’s own Matt Cutts issued a second Kinect bounty, consisting of two $1,000 awards, for “the person or team that writes the coolest open-source app, demo, or program using the Kinect,” as well as the person or team that simplifies the process of writing Linux apps with the Kinect.
This came after Adafruit Industries first offered a $3,000 Kinect bounty for the creation of open-source drivers. Here’s a separate video from last week showing the Kinect running under Linux, with both RGB and depth cameras in operation. Note that this video appeared just three hours after the official release of the Kinect:
Introduction
This article is intended for people who have a lot of experience in the Information Technology area, both as a developer and as systems engineer, especially on unix systems. In fact, the installation of the drivers may be a little tricky, especially if something does not go the first time.
I warn you... there are some commands to run with the terminal, I do not take any responsibility if with these commands (or connecting the kinect) you will damage your Mac. However, if you are familiar with the shell (and unix systems) you should not have problems.
The version of Kinect that i have is sold separately from the xBox. It has the power and the USB adapter included in the package. If you have the version bundled with the latest xBox (that doesn't have the adapter with the power supply), you will need this device from the Amazon website.
I connected the Kinect to an iMac with OSX 10.7.4 64-bit. However, if you read the whole article you'll be able to adapt the installation process on different systems without much effort.
Well, now that I have described the tools used for testing, we can install and configure the software and drivers required.
Driver and SDK
Before proceeding you should know that there are several available API and SDK for Kinect. However, the two main SDK are OpenNI and OpenKinect. The first is maintained by the company PrimeSence who developed the technology behind the Kinect, OpenKinect instead is a group of people who formed a community called OpenKinect which issued the library libfreenect.
There is also the official SDK released by Microsoft, but unfortunately it only works on Windows operating systems. I willanalyzethat in thenext articles.
For this tutorial I used OpenNI. This is because that SDK is developed by the company that has created the technology behind the Kinect, and it comes with many examples.
I used a wrapper for Processing (a programming language based on Java) called Simple OpenNI.
Simple OpenNI is a very good project, but I had to make a number of changes to the installation process to adapt it to the version of Mac OSX that I have. All changes are listed below.
Let's start
First of all, open the page with the official procedure to install Simple OpenNI on Mac OSX clicking here. As described aboveI had toslightly changethe installation procedure. Here's how:
- I download xcode4 fromhere. Then I have installed it.
- I download theversion 2.1.2ofMacPorts(the versionthat is shown in theinstallation guide istoo old) from here. Then I have installed it.
- I downloadJavaJDK7 (forMacOSXx64) fromhere.
- I have openeda terminal andran the command: sudo port install git-core
ifthat commandreturns thefollowing error:
Unable to open port: can’t read 'build.cmd': Failed to locate ‘make’ in path: '/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' or at its MacPorts configuration time location, did you move it?
then you have to start xcode, go to Preferences -> Download and install the 'Command Line Tools', then you can try again the command sudo port install git-core. - Again fromterminalI ranthe following command: sudo port install libtool
- Finally, this: sudo port install libusb-devel +universal
ifthat commandreturns thefollowing error: Please do not install this port since it has been replaced by 'libusb' thenyou have to runthe following commands: - sudo rm -f /opt/local/lib/libusb-1.0.0.dylib
- sudo port clean libusb
- sudo port install libusb +universal
- I download OpenNI_NITE_Installer-OSX from here, I have unzipped it and then ran (inside the unzipped folder) the command sudo ./install.sh
Thiscommand will install thedriverto allowthe proper functioning ofKinect. - I download and installed processing2.0 forMac OSX from here. This is because the version 1.5.x has some problem with the latest versions of Mac OSX. We have to do few changes into the source code of the examples provided with Simple OpenNI. LaterI'll show youhow to do that.
- Now we need todownload the librarySimpleOpenNIforprocessing fromhere. I have unzipped 'SimpleOpenNI.zip'. In this way we geta folder called SimpleOpenNI. You have to copy the folder SimpleOpenNI into the directory /Users/'your username'/Documents/Processing/libraries. If you don't have this folder then create it. The result is shownin the screenshot below.
The folderSimpleOpenNIalso contains severalexamplesthat show how to usekinect, of courseall writtenin Processing.
The Code
Connect theKinectto thewall socket and to the iMac,openProcessingandasample filefrom /Users/'your username'/Documents/Processing/libraries/SimpleOpenNI/examples/OpenNI. OpentheexamplefileUser3d.pdefrom the folder User3d.
Ifwe run the code(nb: you must standat least 1.5 metersfromkinect) we shouldobtain an imagelike the one below. You can see a sort of skeleton that follows the movements of my body:
TheUser3d.pdefile(such asthosepresentin the samples folder)is well commented, if you read the code(and the comments), you can learn how to customizethe code orcreate new programs.
You have tomakesome changesto the source code before tryothersample files.You should know thatProcessing2.0,unlike earlierversions, does not import someessential libraries that oursample files need.
If you try,for example,toexecute the fileHands3d.pde you will receivethe error: Cannot find a class or type named 'Iterator', asshownin the figure below:
To solve this problemwe have to importfor the objectIterator. Iimportedthe librariesjava.io.File(I need it also for other sample files) andjava.util.Iterator. I show youa pictureof the two linesthat I put into the source code:
If you will receiveother exceptionsthenyou need to checkon the Internet(orin the official documentationof Java)which libraryyou have to import.
Another examplethat I tried (andI want recommend to you) istheSlider2d. It allows you to play with some squares on the screen usingyour hands.Belowmy test:
As I wrote before,there aremany interesting examples into the examplesfolder of SimpleOpenNI.I recommend youto try all files.
Use Kinect As Webcam Mac
Sometimes it happensthatprocessingreturns anerror regarding kinect disconnection. In thatcase you have to disconnect and reconnect thedevice.
Kinect For Microsoft
As already mentionedthe source code iswell commented.Thiswill allow you toedit the code according to yourneeds, you will learn to create newprograms.
Kinect For Mac Os Versions
That's all.Have fun!!!