Kinect Test

<< Kinect Resource
This page list the steps I took to test Kinect on Mac OS X. The aim is to make it work on Mac OS X in a programmer-friendly way to quicken the development in higher level (HCI, gesture recognition, and image processing). I combined sources from various open source projects (see Acknowledgement section). This page is currently maintained by Chat.

Framework is available in the internal git:

git clone ssh://oliver.informatik.rwth-aachen.de/Public/Research%20Projects/Kinect/Code/KinectFramework.git

Relatively Stable Stuff

  • 14.11.10: KinectFramework (32-bit, 64-bit, Source) Changed depth image to RGB to cover 16-bit data of the depth.
  • 14.11.10: KinectFramework example (64-bit App Bundle, Source) Changed display to NSImageView which is faster than IKImageView.

Latest Hackaround

  • 14.11.10: KinectFramework (32-bit, 64-bit, Source) Changed depth image to RGB to cover 16-bit data of the depth.
  • 14.11.10: KinectFramework example (64-bit App Bundle, Source) Changed display to NSImageView which is faster than IKImageView.

* 14.11.10: KinectFramework—the first attempt to create a newbie-friendly OS X flavor framework. The framework connects to one Kinect and feed CGImageRef of depth and RGB to the designated delegate. (Framework, Example Project, Source) (x86_64 only, for i386 use the source project and change libusb1.0.dylib to the 32-bit version)
* 13.11.10: qdot published a patch for Mac OS X to improve USB buffering. It runs nicely now. (video)
* 12.11.10: I tried to be independent of cmake and libusb, because I don't like the fact that the developer have to go though painful steps of installing and making. The immediate result is a hacked-around Xcode project that include libusb.dylib and OpenKinect. Note that all codes belongs to the respective contributor, I just try to pack it up such that it is less painful for academic mac developers. Please don't sue me. Xcode Project.
** Usage: Open Xcode project, build, and run. If you are on Mac OS X 10.5, replace the libusb.dylib with libusb.dylib-32bit. You don't need to install CMake or libusb on your system.

A Hard, But Legal Way

Software

  • CMake
  • libusb 1.0.8 get it by: git clone git://git.libusb.org/libusb.git (downloading the zip from Sourceforge won't work)
  • OpenKinect project (reference commit: a676d10a8a01fcbff8d2)


All software are cached on oliver/Software/Device Dependent Software/Kinect

Compiling

Below libusb stands for the root of LIBUSBPATH source, and OKPATH stands for the root of OpenKinect source

  • Install CMake. (I use the binary version.)
  • patch libusb
cd LIBUSBPATH

patch -p0 < OKPATH/platform/osx/libusb-osx-kinect.diff
  • compile and install libusb
cd LIBUSBPATH

./autogen.sh
make
sudo make install
  • Since the previous step doesn't install the header files. (I don't know how to do so.) I have to manually tell cmake where the header file is. Also note that I chose to generate Xcode project by passing "Xcode" after -G. If you want to generate a UNIX Makefiles, you can pass "Unix Makefiles" instead.
cd OKPATH/c

mkdir build
cd build
cmake -D USB_INCLUDE_DIR=LIBUSBPATH/libusb -G Xcode ..
  • The interactive screen of ccmake will appear. Press "c" once to start configure. Then, press "c" again when it prompt you for some reason. Lastly, you will be able to press "g" to generate.
  • At this stage, you should have either Xcode project or makefiles in build folder.
  • Xcode: open the project in the Xcode, go to the Project properties, change Base SDK to Current Mac OSX. Select glview as a target, run. :)
  • Make file: use "make all" to build the project. You will get the binary in some subfolders inside. You can run it by ./glview (for example)

Readings

Acknowledgement


TODO
Clean up this important note about libusb linking in framework
• change dylib id to the path you plan to put it
install_name_tool -id @loader_path/Libraries/libusb-i386.dylib libusb-i386.dylib

Here: @loader_path is referred to the path where binary resides. If you are embedding the library in the framework, @loader_path is the path of framework binary, e.g., "xxx.framework/Versions/A/". If you are embedding the libaray in the application, this will looks like "xxx.app/Content/MacOS"
• add the dylib to "Link Binary With Libraries" build phase
• add the dylib to a new "Copy Files" build phase. Configure the subdirectory to where inside the bundle you want to put dylib in.

Useful tools:
otool -L: for listing the linked library paths
install_name_tool: for modifying the id and paths referred to by a binary


References:

Attachments:
FileDescriptionFile sizeDownloadsLast modified
Download this file (101114 1333 KinectFWTest.zip)101114 1333 KinectFWTest.zipSource165 kB17072010-11-14 14:43
Download this file (101114 KinectFWTest.app.zip)101114 KinectFWTest.app.zip64-bit App Bundle163 kB22552010-11-14 14:42
Download this file (101114 1332 KinectTest.zip)101114 1332 KinectTest.zipSource149 kB19472010-11-14 14:42
Download this file (101114 KinectFramework.frameworkx86_64.zip)101114 KinectFramework.frameworkx86_64.zip64-bit133 kB19302010-11-14 14:38
Download this file (101114 KinectFramework.frameworki386.zip)101114 KinectFramework.frameworki386.zip32-bit47 kB20222010-11-14 14:38
Download this file (101114 KinectTest with framework target.zip)101114 KinectTest with framework target.zipSource145 kB16522010-11-14 02:28
Download this file (101114 KinectFWTest.zip)101114 KinectFWTest.zipExample Project77 kB17732010-11-14 02:28
Download this file (101114 KinectFramework.framework.zip)101114 KinectFramework.framework.zipFramework47 kB17512010-11-14 02:27
Download this file (101113 KinectTest.zip)101113 KinectTest.zipXcode Project141 kB17572010-11-13 11:15
Download this file (Kinect.mov)Kinect.movvideo11252 kB18592010-11-13 11:13
Download this file (KinectTest.zip)KinectTest.zipXcode Project140 kB16052010-11-13 03:10
Cookies make it easier for us to provide you with our services. With the usage of our services you permit us to use cookies.