When OpenNI detects a user the ofxOpenNI UserGenerator class draws the scene with the user in it. The silhouette is a perfect match.
I am trying to isolate the pixels for these ‘user blobs’.
I understand that the GetUserPixels method of the UserGenerator has something to do with this.
I think the solution must be somewhere in the drawScene() method of the ofxUserGenerator class. But I can’t seem to figure it out.
Is there somebody who could help me in isolating the users pixels and drawing them onto an ofImage or something similar?
If you use an image generator stream as well, then something like:
if (depth_generator.IsCapabilitySupported(XN_CAPABILITY_ALTERNATIVE_VIEW_POINT)) {
depth_generator.GetAlternativeViewPointCap().SetViewPoint(image_generator);
}
will register the depth map to the image map - and then you can pull/mask the pixels from the image generator aligned to the users silhouette…
Ok, I think I understand what’s with the error, but can’t seem to fix it.
I’ve checked the console and this is the output:
[Session started at 2011-02-24 00:20:55 +0000.]
dyld: Library not loaded: @executable_path/./../../../data/openni/lib/libnimCodecs.dylib
Referenced from: /Users/george/Downloads/FirefoxDownloads/of_preRelease_v0062_osx_FAT/apps/examples/NI_userIsolation_4/bin/emptyExampleDebug.app/Contents/MacOS/emptyExampleDebug
Reason: no suitable image found. Did find:
/Users/george/Downloads/FirefoxDownloads/of_preRelease_v0062_osx_FAT/apps/examples/NI_userIsolation_4/bin/emptyExampleDebug.app/Contents/MacOS/./../../../data/openni/lib/libnimCodecs.dylib: unknown required load command 0x80000022
/Users/george/Downloads/FirefoxDownloads/of_preRelease_v0062_osx_FAT/apps/examples/NI_userIsolation_4/bin/emptyExampleDebug.app/Contents/MacOS/./../../../data/openni/lib/libnimCodecs.dylib: unknown required load command 0x80000022
The Debugger has exited due to signal 5 (SIGTRAP).The Debugger has exited due to signal 5 (SIGTRAP).
Seems like the app can’t find libnimCodecs.dylib, but it’s in the data folder, and I’ve dragged it onto the xcode project too.
Hi ascorbin! Thanks for posting this example. I am getting linker problem like this
ld: warning: directory '/Applications/of_osx_062/addons/ofxOpenNI/libs/openni/osx' following -L not found
ld: warning: directory '/Applications/of_osX_062/apps/neu2/NI_userIsolation_4/src/ofxOpenNI/mac/copy_to_data_openni_path/lib' following -L not found
ld: warning: directory '/Applications/of_osX_062/apps/neu2/NI_userIsolation_4/src/ofxOpenCv/libs/opencv/lib/osx' following -L not found
ld: library not found for -lJPEG
Any idea where these directories are hardcoded, and how to get JPEG installed? I am running this against standard 062 download.
@boba Sorry to interrupt, but I have a suggestion:
It looks like Xcode Can’t find the libJPEG.dylib file, which you should have in the bin/data/openni/lib folder. Drag the files from the lib folder into your project, but pay attention to the options. You could tick the “Copy items …” option if you like, but the make sure you choose the Relative Path option that suits you from the Reference Type drop down.
I’m guessing the Reference Type somehow got set to Absolute which might explain the ‘hardcoded’ path.
[quote author=“george.profenza”]@boba Sorry to interrupt, but I have a suggestion:
It looks like Xcode Can’t find the libJPEG.dylib file, which you should have in the bin/data/openni/lib folder. Drag the files from the lib folder into your project, but pay attention to the options. You could tick the “Copy items …” option if you like, but the make sure you choose the Relative Path option that suits you from the Reference Type drop down.
I’m guessing the Reference Type somehow got set to Absolute which might explain the ‘hardcoded’ path.
HTH,
george[/quote]
Thanks george! I used the default settings while adding the whole openni folder and that allowed the build to go to completion. Can’t check it with the device though, being on the bus at the moment.
I checked out your code over at Github. Nice work!
Thanks for sharing.
[quote author=“gameover”]Hey, wimvanhenden that method is super-neat!
If you use an image generator stream as well, then something like:
if (depth_generator.IsCapabilitySupported(XN_CAPABILITY_ALTERNATIVE_VIEW_POINT)) {
depth_generator.GetAlternativeViewPointCap().SetViewPoint(image_generator);
}
will register the depth map to the image map - and then you can pull/mask the pixels from the image generator aligned to the users silhouette…