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.

Software


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:

Created by chat. Last Modification: Wednesday 31 of August, 2016 15:38:31 by subramanian.

Media Computing Group at RWTH Aachen

Search

in: