OpenNI Skeleton Tracking

Hey awesome peoples!

Thanks so much for all the feedback over the last couple of days…especially Roxlu for getting onto me so quickly, and having such a great approach to developing this project!

My apologies for having gone offline for a couple of days - I’ve been working on a show using ofxOpenNI that opened on Friday. I’m super excited because a) it’s the first time I’ve got to use the addon in a live show (we’re using it to create registered projections for set elements and as a virtual lighting system for all performers and puppets) and b) because the show is about Indigenous aboriginal creatures from around Australia, and is one of the first times some of these creatures have been allowed to be talked about and performed for general public audiences…

…but I digress…

I agree that we should move discussion of further development of ofxOpenNI to a new thread: this one is monstrously long…and by the time you read 14 pages of conflicting implementations, instructions, forks, pleas for help, etc anyone trying to start out is bound to be confused.

So on that note I’m opening ofxOpenNI-Development

Once we’ve sorted out how to merge/move the repo’s I’ll start another thread for support, installation and implementation help and update a link here.

Were are you from gameover? Im a melbourne dev doing similar things. Is the show still on, im in Sydney on saturday

I am indeed based in sunny Melbourne :wink:

The show is still on: it’s made by a company called Erth and is called ‘I, Bunyip’. It’s part of the Sydney Children’s Festival - so it’s obviously aimed at kids - and is on at Carriageworks.

Let me know if you manage to catch a show (or indeed PM me if you have trouble getting in - I think a lot of sessions are sold out). And get in touch when you’re back in Melbourne!

M

Hi,

I have manage to recompile the library and everything fine. However I am wondering how I can make the system recognise specific gesture and train/teach it to recognise new one.

Many thanks

@kinrou,
openNI can recognize hand gestures like hand up, wave and push with the current implementation of ofxOpenNI.
Use the ofxGestureGenerator class for this task.
I guess that you can recognize more gestures but I haven´t gone that far in this issue.
Read the OpenNI and NITE docs and check the posibilities that you can get for gesture recognition.
If there’s no option you might need to use an external gesture learning and recognition library.
good luck!

@roymacdonald

Thanks for the feedback. yes I think I have to read further the OpenNI and NITE doc.

WHat is the purpose of the recorder class? It outputs a *.oni file.
At first I thought it was to do with recording a gesture and then some how load it and being able to use to trigger something. But it’s not, is it?

Thanks

@kinrou,
the recorder class records the camera input. It’s quite useful for debugging.

good luck with the reading.

hi

i am trying to get ofxopenni working on osx 10.6.8 with xcode 3.2.4 and OF007

i followed gameoverhack’s instruction from here:https://github.com/gameoverhack/ofxOpenNI/tree/experimental

i.e.
git clone https://github.com/gameoverhack/ofxOpenNI.git
cd ofxOpenNI
git checkout experimental (also tried git checkout master)

the example compiles fine but when i try to run it i get this error:

dyld: Library not loaded: /opt/local/lib/libusb-1.0.0.dylib
Referenced from: /Applications/of_preRelease_v007_osx/apps/addonsExamples/opeNI-SimpleExamples/bin/openNISample007Debug.app/Contents/MacOS/./…/…/…/data/openni/lib/libOpenNI.dylib
Reason: image not found
sharedlibrary apply-load-rules all
Data Formatters temporarily unavailable, will re-try after a ‘continue’. (Cannot call into the loader at present, it is locked.)

it’s strange that it does not see this library: libusb-1.0.0.dylib

because i copied the lib folder in the bin/data/openni/ location
and it does show up in xcode (it’s not highlighted red)

what am i doing wrong?

thanks.

update:
ok i got it to work.

using the terminal i cd pathToMyLibFolderInsideTheDataFolder
then dragged the change_exec_paths.sh script on the terminal and hit enter

i guess this somehow change some paths inside the libraries

yes you must run that script.

it changes the relative paths inside the libs so these get linked correctlly.

Actually you shouldn’t need to run that script as it sets relative paths and should already be correct…

However a few people have reported problems with libusb after I did the latest update to openNI drivers…

If running that script makes it work for you, please let me know (that would mean I did not run it on libusb)…

However if that does not work you may need to install libusb on your computer (it is both a dependency of openNI and is used by the ofxHardwareDriver so I need to figure out which one is trying to load the dyld from the wrong place)

To install libusb you can use this command in Terminal:

  
sudo port install libusb-devel +universal  

If you could let me know which solution solves the problem it would help me as it’s quite hard to check the install on every computer/platform configuration…

Thanks
M

all i did is download ofxopenni from your github, followed the instruction in the read me, renamed one of the src-ImageAndDepth-Simple folder to src and ran the change_exec_paths.sh script

i tried running some of the other src folder but ran in to some problem, which i don’t remember right now in detail.

thanks for this addon

This however does require MacPorts which in my experience downloads a bunch of other libs. PCL has a nice version here that installs libusb into opt/local http://dev.pointclouds.org/attachments/download/502/libusb-devel-1.0.8.20101017-2.dmg

hi

followed the instructions in https://github.com/gameoverhack/ofxOpenNI/ and, voilá, works like a charm! one question: does that codebase allow for skeleton access? i can see my hand being tracked and all that but not my skeleton (skeleton tracking is on).

does this implementation require the user to “strike the pose”?

the openni sample (Sample-NiUserSelection) works fine.

thanks a lot!

Hi

This library does indeed track skeletons. I added this to the sample code to see the skeletons in the draw() function just below recordUser.draw():

  
  
			int nTrackedUsers = recordUser.getNumberOfTrackedUsers();  
			ofxTrackedUser *tracked = NULL;  
			for (int i=0; i<nTrackedUsers; i++) {  
				// get the user  
				tracked = recordUser.getTrackedUser(i);  
				if(tracked != NULL) {  
					tracked->debugDraw();  
				}  
			}  
  

But it seems it does require the “special pose” in order to be detected. Does anyone know if non-pose detection is possible in oF on Mac (without using BootCamp + Windows)?

try the experimental branch
https://github.com/gameoverhack/ofxOpenNI/tree/experimental

it has a different implementation and it’s supposed to be v2.0
there you have no pose skeleton tracking.

don’t be afraid of the word “experimental” it works really well. I’ve been using it for months now.

cheers!

Hi

Unfortunately I couldn’t manage to get the experimental example to compile. The master branch example is pretty self-contained and just needs a few changes here and there but the experimental one was above my XCode-fu. Is there a way to make master examples work with experimental? I just did “git checkout experimental” to override whatever I had from master.

Thanks

No, it won’t work.
The experimental branch was completely rewritten and is way much easier to use, but it’s not compatible with the master branch.
it’s fine what you did with git.
What are you getting when trying to compile the experimental example?

Hi

I’m on: oF 0071, Mac OS 10.7.4, XCode 4.1

  • git checkout experimental (in the addons/ofxOpenNI folder of my oF install)
  • copy the mac/…/lib folder to the example bin/data folder
  • open the openNiSample007.xcodeproj file

Once here I see the project file has a bunch of missing links:

If I run it immediately, it clearly crashes with:

  
CompileC build/openNiSample007.build/Debug/openNISample007.build/Objects-normal/i386/testApp.o src/testApp.cpp normal i386 c++ com.apple.compilers.llvmgcc42  
    cd /Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples  
    setenv LANG en_US.US-ASCII  
    /Developer/usr/bin/llvm-gcc-4.2 -x c++ -arch i386 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -Os -fasm-blocks -Wno-deprecated-declarations -Wno-invalid-offsetof -gdwarf-2 -msse3 -mssse3 -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/openNISample007Debug.hmap -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/bin/include -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/DerivedSources/i386 -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/DerivedSources -F/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/bin -F/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/../../../libs/glut/lib/osx -D__MACOSX_CORE__ -lpthread -include /var/folders/87/1983zd5j42nby3hc3fyzkss00000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/Carbon-ccirklsopjawodevnyoqxdzljugm/Carbon.h -c /Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/src/testApp.cpp -o /Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/Objects-normal/i386/testApp.o  
  

I tried fixing one by one but couldn’t get past this as more errors would appear. Is there a way to fix the xcodeproj in a less manual way?

Thanks

can you copy and paste the complete console log. what you’ve pasted doesn’t reveal the issue.

I guess this is it:

  
  
Build target openNISample007  
  
CompileC build/openNiSample007.build/Debug/openNISample007.build/Objects-normal/i386/main.o src/main.cpp normal i386 c++ com.apple.compilers.llvmgcc42  
    cd /Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples  
    setenv LANG en_US.US-ASCII  
    /Developer/usr/bin/llvm-gcc-4.2 -x c++ -arch i386 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -Os -fasm-blocks -Wno-deprecated-declarations -Wno-invalid-offsetof -gdwarf-2 -msse3 -mssse3 -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/openNISample007Debug.hmap -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/bin/include -I../../../../libs/openFrameworks -I../../../../libs/openFrameworks/3d -I../../../../libs/openFrameworks/app -I../../../../libs/openFrameworks/communication -I../../../../libs/openFrameworks/events -I../../../../libs/openFrameworks/gl -I../../../../libs/openFrameworks/graphics -I../../../../libs/openFrameworks/math -I../../../../libs/openFrameworks/sound -I../../../../libs/openFrameworks/types -I../../../../libs/openFrameworks/utils -I../../../../libs/openFrameworks/video -I../../../../libs/poco/include -I../../../../libs/freetype/include -I../../../../libs/freetype/include/freetype2 -I../../../../libs/fmodex/include -I../../../../libs/glew/include -I../../../../libs/FreeImage/include -I../../../../libs/tess2/include -I../../../../libs/cairo/include/cairo -I../../../../libs/rtAudio/include -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/DerivedSources/i386 -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/DerivedSources -F/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/bin -F/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/../../../libs/glut/lib/osx -D__MACOSX_CORE__ -lpthread -include /var/folders/87/1983zd5j42nby3hc3fyzkss00000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/Carbon-gwferhicxbnfmrekyirzxpnsggal/Carbon.h -c /Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/src/main.cpp -o /Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/Objects-normal/i386/main.o  
  
Command /Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1  
  
CompileC build/openNiSample007.build/Debug/openNISample007.build/Objects-normal/i386/testApp.o src/testApp.cpp normal i386 c++ com.apple.compilers.llvmgcc42  
    cd /Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples  
    setenv LANG en_US.US-ASCII  
    /Developer/usr/bin/llvm-gcc-4.2 -x c++ -arch i386 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -Os -fasm-blocks -Wno-deprecated-declarations -Wno-invalid-offsetof -gdwarf-2 -msse3 -mssse3 -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/openNISample007Debug.hmap -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/bin/include -I../../../../libs/openFrameworks -I../../../../libs/openFrameworks/3d -I../../../../libs/openFrameworks/app -I../../../../libs/openFrameworks/communication -I../../../../libs/openFrameworks/events -I../../../../libs/openFrameworks/gl -I../../../../libs/openFrameworks/graphics -I../../../../libs/openFrameworks/math -I../../../../libs/openFrameworks/sound -I../../../../libs/openFrameworks/types -I../../../../libs/openFrameworks/utils -I../../../../libs/openFrameworks/video -I../../../../libs/poco/include -I../../../../libs/freetype/include -I../../../../libs/freetype/include/freetype2 -I../../../../libs/fmodex/include -I../../../../libs/glew/include -I../../../../libs/FreeImage/include -I../../../../libs/tess2/include -I../../../../libs/cairo/include/cairo -I../../../../libs/rtAudio/include -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/DerivedSources/i386 -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/DerivedSources -F/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/bin -F/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/../../../libs/glut/lib/osx -D__MACOSX_CORE__ -lpthread -include /var/folders/87/1983zd5j42nby3hc3fyzkss00000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/Carbon-gwferhicxbnfmrekyirzxpnsggal/Carbon.h -c /Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/src/testApp.cpp -o /Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/Objects-normal/i386/testApp.o  
  
CompileC build/openNiSample007.build/Debug/openNISample007.build/Objects-normal/i386/ofxOpenNITypes.o ../../../addons/ofxOpenNI/src/ofxOpenNITypes.cpp normal i386 c++ com.apple.compilers.llvmgcc42  
    cd /Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples  
    setenv LANG en_US.US-ASCII  
    /Developer/usr/bin/llvm-gcc-4.2 -x c++ -arch i386 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -Os -fasm-blocks -Wno-deprecated-declarations -Wno-invalid-offsetof -gdwarf-2 -msse3 -mssse3 -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/openNISample007Debug.hmap -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/bin/include -I../../../../libs/openFrameworks -I../../../../libs/openFrameworks/3d -I../../../../libs/openFrameworks/app -I../../../../libs/openFrameworks/communication -I../../../../libs/openFrameworks/events -I../../../../libs/openFrameworks/gl -I../../../../libs/openFrameworks/graphics -I../../../../libs/openFrameworks/math -I../../../../libs/openFrameworks/sound -I../../../../libs/openFrameworks/types -I../../../../libs/openFrameworks/utils -I../../../../libs/openFrameworks/video -I../../../../libs/poco/include -I../../../../libs/freetype/include -I../../../../libs/freetype/include/freetype2 -I../../../../libs/fmodex/include -I../../../../libs/glew/include -I../../../../libs/FreeImage/include -I../../../../libs/tess2/include -I../../../../libs/cairo/include/cairo -I../../../../libs/rtAudio/include -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/DerivedSources/i386 -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/DerivedSources -F/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/bin -F/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/../../../libs/glut/lib/osx -D__MACOSX_CORE__ -lpthread -include /var/folders/87/1983zd5j42nby3hc3fyzkss00000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/Carbon-gwferhicxbnfmrekyirzxpnsggal/Carbon.h -c /Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/../../../addons/ofxOpenNI/src/ofxOpenNITypes.cpp -o /Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/Objects-normal/i386/ofxOpenNITypes.o  
  
CompileC build/openNiSample007.build/Debug/openNISample007.build/Objects-normal/i386/ofxOpenNI.o ../../../addons/ofxOpenNI/src/ofxOpenNI.cpp normal i386 c++ com.apple.compilers.llvmgcc42  
    cd /Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples  
    setenv LANG en_US.US-ASCII  
    /Developer/usr/bin/llvm-gcc-4.2 -x c++ -arch i386 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -Os -fasm-blocks -Wno-deprecated-declarations -Wno-invalid-offsetof -gdwarf-2 -msse3 -mssse3 -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/openNISample007Debug.hmap -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/bin/include -I../../../../libs/openFrameworks -I../../../../libs/openFrameworks/3d -I../../../../libs/openFrameworks/app -I../../../../libs/openFrameworks/communication -I../../../../libs/openFrameworks/events -I../../../../libs/openFrameworks/gl -I../../../../libs/openFrameworks/graphics -I../../../../libs/openFrameworks/math -I../../../../libs/openFrameworks/sound -I../../../../libs/openFrameworks/types -I../../../../libs/openFrameworks/utils -I../../../../libs/openFrameworks/video -I../../../../libs/poco/include -I../../../../libs/freetype/include -I../../../../libs/freetype/include/freetype2 -I../../../../libs/fmodex/include -I../../../../libs/glew/include -I../../../../libs/FreeImage/include -I../../../../libs/tess2/include -I../../../../libs/cairo/include/cairo -I../../../../libs/rtAudio/include -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/DerivedSources/i386 -I/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/DerivedSources -F/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/bin -F/Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/../../../libs/glut/lib/osx -D__MACOSX_CORE__ -lpthread -include /var/folders/87/1983zd5j42nby3hc3fyzkss00000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/Carbon-gwferhicxbnfmrekyirzxpnsggal/Carbon.h -c /Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/../../../addons/ofxOpenNI/src/ofxOpenNI.cpp -o /Users/mga/Documents/experimental/of_0071_osx_release/addons/ofxOpenNI/examples/opeNI-SimpleExamples/build/openNiSample007.build/Debug/openNISample007.build/Objects-normal/i386/ofxOpenNI.o