I'm researching an appropriate (or at least straightforward stack) for ultimately getting skeleton information from a kinect, via a python api on an OSX platform. Most of the information I am finding is quite spread out and disconnected.
While it seems perfectly obvious that a windows-based stack would be microsoft's own pykinect on top of their kinect SDK, I can't seem to figure out what works well in an OSX environment.
Here is the info that I have compiled so far:
I have concluded that this is the most recommended stack to date. What I would like to achieve is simple skeleton data similar to what the windows SDK python wrapper gives you out of the box. Ultimately I will be using this in a PyQt-based app to draw the display, and then into Maya to apply the data.
My question is two parts, and I would accept an answer in either direction if it were the most appropriate...
Build issues for PyOpenNI
So far, I have been unable to successfully build PyOpenNI on either OSX Snow Leopard (10.6.8), or Lion (10.7.4). Both systems have updated xcode. I have noticed that the source files are hardcoded to expect python2.7, so on snow leopard I have had to make sure it was installed and the default version (also tried a virtualenv).
On Snow Leopard, I was seeing the cmake process find different libs, headers, bin for python, and ultimately the make produced an .so that crashed with 'mismatched interpreter'.
On Lion, I also got mismatched interpreter crashes. But after I installed python2.7 via homebrew, it generated a new error:
ImportError: dlopen(./openni.so, 2): Symbol not found: _environ
Referenced from: /usr/local/lib/libpython2.7.dylib
Expected in: dynamic lookup
Are there any specific steps to building this on OSX that I am missing, such as environment variables to ensure its pointing at the correct python2.7 libs? Does anyone have a successful build process for this platform?
Alternate question
Is this still the most recommended stack for OSX?
Follow up
I've accepted my own answer as a temporary working solution. If someone can provide a better one, I will gladly accept it!
Update
Part of this process isn't necessary after a patch I submitted (information here). Since then I have also written up a more detailed blog post about installing the entire stack on OSX: Getting Started With Xbox360 Kinect On OSX
After hacking around on this a bit, I have found a working fix (though it doesn't address the issue at the build level). There is an existing issue with cmake, where it does not properly detect other python frameworks besides the system framework (which causes the mismatch between the python binary and the libs).
I first reinstalled my python2.7 install via homebrew, adding the --framework flag
After building the module, I noticed via otool that it was still linking to my system python, and the system python on Lion is fat i386 and x86_64. I also noticed that the libboost (boost installed via homebrew) which was linked to openni.so was also linked against the system python instead of homebrew. So I used the following to relink them:
install_name_tool -change \
/System/Library/Frameworks/Python.framework/Versions/2.7/Python \
/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Python \
openni.so
install_name_tool -change \
/System/Library/Frameworks/Python.framework/Versions/2.7/Python \
/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Python \
/usr/local/Cellar/boost/1.49.0/lib/libboost_python-mt.dylib
After doing this, I was able to import openni without any errors.
Here is the summary of the workaround:
export CPPFLAGS="-arch x86_64"
Ideally, someone would post a better answer than this one showing how to fix this during the build phase with environment variables, and not have to do a relink fix at the end.