gameoverhack / ofxopenni Goto Github PK
View Code? Open in Web Editor NEWWrapper for OpenNI, NITE and SensorKinect
Home Page: gingold.com.au
License: Other
Wrapper for OpenNI, NITE and SensorKinect
Home Page: gingold.com.au
License: Other
Just wanted to update that I experienced this issue:
#9
To resolve, I had to do a tiny mod to jvcleave's solution:
sudo port install libusb +universal
*note you'll need to install macports first. http://www.macports.org/install.php
Best,
Jason
Hi, may be you forget to say to copy also the config dir in bin/data/openni?
because without config dir the app crash with BAD ACCESS MEMORY in connection to kinect (XnCppWrapper.h). Adding the config dir resolve the issue...
Regards
After following all of the described steps I get this (last?) error on El Capitan and Xcode:
ld: library not found for -lXnDDK
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How to solve that?
Am I missing another step?
I didn't find anything else online.
Thanks!
Hi - I'm working on an oF project that exports ONI files as OBJs for use in a 3D modeling program. It utilizes ofxOpenNI's depth generator to show a color delineated depthImage of the captured ONI file. The interface allows you to set the z depth for the vertices that should be exported, but without a visual representation of this, it's hard to know where to set that depth range. Is there any way to tell the depth generator what z range to display?
I followed the precise instructions to get the example code working on OS X, but whenever I build (it compiles), (and on linking) I get the following error:
ld: library not found for -lXnFormats
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Basically the linker cannot find -lXnFormats
.
What can be done to solve this error?
PS: I am using XCode 7.1 with OS X El Capitan v10.11.1.
ofxOpenNIUser& ofxOpenNI::getTrackedUser(int index);
takes an "index-user-Id", but that's not the same as the XnUserID that's in ofxOpenNIUserEvent.
I've added a ofxOpenNIUser& ofxOpenNI::getUser(XnUserID nID)
function that uses a XnUserID to get a tracked user.
There's already a ofxOpenNIHand& ofxOpenNI::getTrackedHand(int index)
and a ofxOpenNIHand& ofxOpenNI::getHand(XnUserID nID)
, so... this is just the ofxOpenNIUser equivalent of that...
Let me know, and I can PR my additions.
I followed the instructions as told in the README, but still, I get the following error:
C:\Users\ranve\Documents\BTP\of_v0.8.4_win_cb_release\addons\ofxOpenNI\src\ofxOpenNIUtils.h|35|fatal error: XnOpenNI.h: No such file or directory|
What can the possible issue be? Also, I'm not very clear of what to do with the libs directory. Can someone please elaborate on it?
In the current version:
dyld: Library not loaded: /opt/local/lib/libusb-1.0.0.dylib
Referenced from: /Users/drambald/Code/of_0071_osx_release/Code/kinactor_project/OniActor/bin/OniActorDebug.app/Contents/MacOS/./../../../data/openni/lib/libOpenNI.dylib
Reason: image not found
you have linked the libusb from /opt/local/lib
running otool:
otool -L libOpenNI.dylib
libOpenNI.dylib:
@executable_path/./../../../data/openni/lib/libOpenNI.dylib (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.44.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/opt/local/lib/libusb-1.0.0.dylib (compatibility version 2.0.0, current version 2.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
Can you link the version in data/openni please?
I can't seem to get Threading to work on OS X 10.6 (haven't tried 10.7)
the app compiles, finds the kinect, starts the generators but never opens a window
After 3 hours of research, got a clean & working solution:
Change the config.make like this:
PROJECT_LDFLAGS=-Wl,-rpath=./libs,/usr/lib/libOpenNI.so
PROJECT_CFLAGS = -I /usr/include/ni -I $(OF_ROOT)/addons/ofxOpenNI/src
works with OpenNI & Nite 1.5, not tested with OpenNI 2.
Why are the examples 1 level too deep and not separate projects? It'd be nice to just run the examples right out of the folder, like most other addons.
Also, why not put the libraries into the standard OF addon layout with:
libs/libusb/include/libusb.h libs/nite/include/*.h libs/openni/include/*.h libs/openni/lib/win32/*.dll, etc libs/openni/lib/osx/*.dylib, etc
Naturally, note moving the dlls and dylibs, but that could be done with a script etc.
I'm doing a speed project right now but I can do a PR for this later.
It seems like these are reversed to me - with registerViewport the image/depth should be aligned and with unregisterViewport the image and depth views are offset
also an interesting issue that may be an OpenNI bug but if the image/depth are aligned UserReEnter and UserExit callbacks are never fired
i have this error in execution:
dyld: Library not loaded: /opt/local/lib/libusb-1.0.0.dylib
Referenced from: /Users/viniciolindo/Documents/of_preRelease_v007_osx/apps/myApps/openNI-demoAllFeatures/bin/openNISample007Debug.app/Contents/MacOS/./../../../data/openni/lib/libOpenNI.dylib
Reason: image not found
it's strange because libusb is in correct folder that is: myAppsFolder/example/bin/data/openni/lib/
Hi,
First of all, I would like to appreciate your hard work writing this class and sharing for all the community.
I have some problems when I mesh your class with ofxFluid.
I can add the ofxFluid addon but when I call the class:
ofApp.h
#pragma once
#include "ofMain.h"
#include "ofxOpenNI.h"
#include "ofxFluid.h"
class testApp : public ofBaseApp{
public:
void setup();
void update();
void draw();
void keyPressed(int key);
void keyReleased(int key);
void mouseMoved(int x, int y);
void mouseDragged(int x, int y, int button);
void mousePressed(int x, int y, int button);
void mouseReleased(int x, int y, int button);
void windowResized(int w, int h);
void dragEvent(ofDragInfo dragInfo);
void gotMessage(ofMessage msg);
void exit();
void userEvent(ofxOpenNIUserEvent & event);
ofxOpenNI openNIDevice;
ofTrueTypeFont verdana;
ofxFluid fluid;
Appears some errors:
Undefined symbols for architecture i386:
"vtable for ofxFluid", referenced from:
ofxFluid::~ofxFluid() in testApp.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"ofxFXObject::~ofxFXObject()", referenced from:
ofxFluid::~ofxFluid() in testApp.o
"ofxFluid::ofxFluid()", referenced from:
Fluids::Fluids() in main.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any one know how to solve it?
Thank you so much.
running the example with the experimental branch it looks like kinects are detected and initialised okay but the second kinect output is always rendered black.
as far as i can tell, calling addAllHandFocusGestures()
(like in the simple hands example) doesn't actually call the testApp::handEvent()
method. is there an extra line of code that's necessary to hook these up, is there a bug inside ofxOpenNI, or am i misunderstanding what kind of gestures "wave", "click" and '"raise arm" are? :)
hi
i feel like i am missing something there are a number of references to hitting "t" and switching from hand to skeleton, but i am not seeing it.
See a couple of validation logic
nUserNum - 1 > max_num_users
nUserNum - 1 > found_users
If userNum starts from 1, do we really need to - 1? Or am I missing something...
It seems like in version 1.0 there were swipeLeft and swipeRight gestures. This version has them removed. Does adding support for those gestures require a different file in the openni/config directory or merely additional code somewhere in the larger implementation of the addon?
Got the example working fine with an xbox kinect 1414, but a Primesense RD1.082 causes a crash.
Not sure how to communicate the stack trace.. the debugging console says:
[ofxOpenNIDevice[0]:warning] Using a NASTY hack to silence SIGNAL errors on exit - read the comments at line ~1712 of ofxOpenNI.cpp
[ofxOpenNIDevice[0]:notice] Init context...
[ofxOpenNIDevice[0]:verbose] Context initilizedstatus:OK
[ofxOpenNIDevice[0]:notice] openni driver version: 1.5.4.0
[ofxOpenNIDevice[0]:notice] Adding licence...
[ofxOpenNIDevice[0]:verbose] Adding licence: PrimeSense xxxobscuredxxx=status:OK
[ofxOpenNIDevice[0]:notice] Init device...
[ofxOpenNIDevice[0]:verbose] Enumerate devicesstatus:OK
[ofxOpenNIDevice[0]:notice] Found1devices connected
[ofxOpenNIDevice[0]:verbose] Creating production tree for device 0status:OK
[ofxOpenNIDevice[0]:notice] Adding generator typeXN_NODE_TYPE_IMAGE
[ofxOpenNIDevice[0]:verbose] Creating XN_NODE_TYPE_IMAGE generatorstatus:OK
[ofxOpenNIDevice[0]:verbose] Setting Image1 resolution: 640 x 480 at 30fpsstatus:OK
[ofxOpenNIDevice[0]:verbose] Starting XN_NODE_TYPE_IMAGE generatorstatus:OK
[ofxOpenNIDevice[0]:verbose] Allocating image
[ofxOpenNIDevice[0]:notice] Adding generator typeXN_NODE_TYPE_DEPTH
[ofxOpenNIDevice[0]:verbose] Creating XN_NODE_TYPE_DEPTH generatorstatus:OK
[ofxOpenNIDevice[0]:verbose] Setting Depth1 resolution: 640 x 480 at 30fpsstatus:OK
[ofxOpenNIDevice[0]:verbose] Starting XN_NODE_TYPE_DEPTH generatorstatus:OK
[ofxOpenNIDevice[0]:verbose] Allocating depth
[ofxOpenNIDevice[0]:verbose] Register viewpoint depth to RGBstatus:OK
[ofxOpenNIDevice[0]:verbose] Set mirror depth ONstatus:OK
[ofxOpenNIDevice[0]:verbose] Set mirror image ONstatus:OK
[ofxOpenNIDevice[0]:notice] Adding generator typeXN_NODE_TYPE_USER
Dies in #0 0x00f4d010 in NACommonData::Downscale(unsigned short const_, unsigned short_, int, int, int) () with EXC_BAD_ACCESS
Openframeworks 0.7.4
What's the function to change the angle of the kinect?
Hi,
I am trying to use ofxSynapse and I see this requires ofxOSC and ofxOpenNI.
I also noticed ofxOCS is already included in the current pkg but ofOpenNI, I got it from https://github.com/gameoverhack/ofxOpenNI and ofxSynapse from https://github.com/pierrep/ofxSynapse. I included ofxSynapse src and includes in Header Search Path but it still can not find it..
Hello, I've been trying to make a project that plays back .oni files by creating and deleting ofxOpenNI objects. (I find that if I initialise the objects afetr they are created then threading doesn't work, hence this approach).
I'm running into problems while deleting the objects. updateUserTracker(); is often called after the usertacker is deleted, causing a crash.
Looking at the source code, I notice this commented out statement in ofxOpenNI::stop(); , ofxOpenNI.cpp line 349
//waitForThread(true);
I've found that if I uncomment this, but comment out the mutex.lock() on line 345, creating and deleting objects works perfectly and I still get multithreaded performance.
Why was this line commented out? Does this approach cause problems elsewhere?
I'm using x64 linux and the git version of OF. I believe I'm seeing identical results on OSX with the latest published version.
Tim Redfern
Example projects with User Generators often crash on quit for me - OS X 10.7.5 using latest from Master.
The issue is usually:
libXnVFeatures_1_5_2.dylib 'NACommonData::Update():
This line: 0xc26c55 movl (%eax), %eax
Triggers this: Thread 11: EXC_BAD_ACCESS (code=2, address=0x0)
Any ideas what's going on?
Gameover you mentioned updated hotspot code on GitHub? But I don't see any User/Threshold/Mask stuff (the Hand example doesn't seem to work the way I need) that can help the following situation:
Currently - I've set the DepthThreshold here:
ofxOpenNIDepthThreshold depthThreshold = ofxOpenNIDepthThreshold(0,3500, false, true, true, true, true);
openNIDevice.addDepthThreshold(depthThreshold);
and, I want the threshold to control whether the users are "seen"
numBodies = openNIDevice.getNumTrackedUsers();
if (numBodies >0){
// 'tracked' users are still found regardless of depth!!!
ofPushMatrix();
ofEnableBlendMode(OF_BLENDMODE_ALPHA);
// iterate through users
for (int i = 0; i < numBodies; i++){
ofxOpenNIUser & body = openNIDevice.getTrackedUser(i);
body.setUseMaskTexture(true);
body.setUseMaskPixels(true);
ofPixels p = body.getMaskPixels();
body.drawMask();
//not working reliably b/c UserTracking event may not have fired yet
//ofxOpenNIROI roi = depththreshold.getROI()
//roi.inside(body.getCentroid())
...
however, getNumTrackedUsers() finds these users even if they are beyond the threshold.
What do I need to set to "register" the thresholding and control the viewport (ignoring users above z ==3500 for example)
I've tried the roi.inside() and a number of other possibilities but it doesn't work for users before they are technically "found" so I can't depend on the USER_TRACKED event.position. USER_CALIBRATION_REGISTERED doesn't have position info...
thanks for any ideas!!!
Cindy
Enabling threading in any of the examples prevents openFramework's GUI thread from running on Windows 7.
I'm working on kinect 1414 and trying to start the example on Mac Pro with OSX El Capitan.
The build was success but what I got is a just grey screen.
The console are written as below:
[warning] ofxOpenNIDevice[0]: Using a NASTY hack to silence SIGNAL errors on exit - read the comments at line ~1712 of ofxOpenNI.cpp
[notice ] ofxOpenNIDevice[0]: Init context...
[verbose] ofxOpenNIDevice[0]: Context initilizedstatus:OK
[notice ] ofxOpenNIDevice[0]: openni driver version: 1.5.4.0
[notice ] ofxOpenNIDevice[0]: Adding licence...
[verbose] ofxOpenNIDevice[0]: Adding licence: PrimeSense 0KOIk2JeIBYClPWVnMoRKn5cdY4=status:OK
[notice ] ofxOpenNIDevice[0]: Init device...
[verbose] ofxOpenNIDevice[0]: Enumerate devicesstatus:OK
[notice ] ofxOpenNIDevice[0]: Found1devices connected
[verbose] ofxOpenNIDevice[0]: Creating production tree for device 0status:Failed to open the USB device!
[warning] ofxOpenNIDevice[0]: REAL Device could not be initialized - you can still use an ONI
[notice ] ofxOpenNIDevice[0]: Adding generator typeXN_NODE_TYPE_IMAGE
[verbose] ofxOpenNIDevice[0]: Creating XN_NODE_TYPE_IMAGE generatorstatus:Can't create any node of the requested type!
[ error ] ofxOpenNIDevice[0]: setGeneratorResolution() called on invalid generator!
[notice ] ofxOpenNIDevice[0]: Adding generator typeXN_NODE_TYPE_DEPTH
[verbose] ofxOpenNIDevice[0]: Creating XN_NODE_TYPE_DEPTH generatorstatus:Failed to open the USB device!
[ error ] ofxOpenNIDevice[0]: setGeneratorResolution() called on invalid generator!
[verbose] ofxOpenNIDevice[0]: Depth generator is not on
[notice ] ofxOpenNIDevice[0]: Adding generator typeXN_NODE_TYPE_USER
[verbose] ofxOpenNIDevice[0]: Creating XN_NODE_TYPE_USER generatorstatus:Failed to open the USB device!
[verbose] ofxOpenNIDevice[0]: Starting XN_NODE_TYPE_USER generatorstatus:Failed to open the USB device!
[notice ] ofxOpenNIDevice[0]: Starting ofxOpenNI with threading
[warning] ofThread: - name: Thread 1 - Calling startThread with verbose is deprecated.
[verbose] ofThread: - name: Thread 1 - Started Thread.
ofxOpenNIDevice[0]: stop called
ofxOpenNIDevice[0]: trying to lock
ofxOpenNIDevice[0]: trying to stop thread
ofxOpenNIDevice[0]: releasing all nodes
ofxOpenNIDevice[0]: releasing context
[ofxOpenNIDevice[0]verbose: releasing depth texture & pixels]
ofThread: ofxOpenNIDevice[0]- name: Thread 1 - Thread Finished.: releasing image texture & pixels
ofxOpenNIDevice[0]: full stopped
ofxOpenNIDevice[0]: destructor called
ofxOpenNIDevice[0]: stop called
It can found my kinect connected but cant access it.
Anyone has idea how to fix this problem?
Thank you so much!
Hi,
I've tested the latest experimental version and had some issues with the tracking ( as described in http://forum.openframeworks.cc/index.php/topic,7403.msg46750.html#msg46750 ).
After further testing i found some possible problem.
At the ofxOpenNI::requestCalibration method ( line 2892) : currentTrackedUsers[nID] = baseUser ;
At the moment you assign the baseUser to the map the maskPixelFormat information is lost which causes the problems i had.
I added currentTrackedUsers[nID].setMaskPixelFormat(ofPixelFormat::OF_PIXELS_RGBA); to the method.
Now most problems seemed to be gone. The tracking works most of the time .(the main problem sometimes is when i leave the camera and come quick back then sometimes the tracking doesn't work. )
I am trying to get it to run with win7 64bit and 64bit openNI drivers and code::blocks.
error: missing openNI.dll .
I'm running into a weird error- Its happening the same with OSX 10.8 and linux64
I'm trying to create a new ofxOpenNI() from a pointer and delete it. The reason for this is because I need to open a series of .oni files, and it re-opening an ofxOpenNI from a different file doesn't work for me - threading won't work, and it crashes erratically even without threading.
If I make a new ofxOpenNI() from a pointer, it works good, I can keep creating them and threading keeps working. I can display the colour image and the depth image. However if I try to access the depthGenerator I get a crash- getDepthGenerator() seems to return a pointer to 0x00. However if I try to add a depthGenerator it says one exists and "there can only be one".
How it crashes, is that I first
const XnDepthPixel* depthmap=player->getDepthGenerator().GetDepthMap();
and I get a crash at
ofPoint p= player->projectiveToWorld(ofPoint(i,j,(float)(depthmap[j*depthW+i])));
The place the crash occurs at is line 1827 of XnCppWrapper.cpp
inline XNNodeHandle GetHandle() const { return m_hNode; }
*this is pointing at 0x3f8 - would seem to be an unitialised pointer to depthGenerator.
The same technique works fine if I just declare the ofxOpenNI as a class member and let it initialise itself when openframeworks begins.
Any thoughts? I'm baffled.
I get 4 linker errors when running the openNISample007 example in xcode.
Undefined symbols for architecture i386: "_CVDisplayLinkGetNominalOutputVideoRefreshPeriod", referenced from: _vidmodeFromCGDisplayMode in libglfw3.a(cocoa_monitor.m.o) "_CVDisplayLinkCreateWithCGDisplay", referenced from: __glfwSetVideoMode in libglfw3.a(cocoa_monitor.m.o) __glfwPlatformGetVideoMode in libglfw3.a(cocoa_monitor.m.o) __glfwPlatformGetVideoModes in libglfw3.a(cocoa_monitor.m.o) "_CVDisplayLinkRelease", referenced from: __glfwSetVideoMode in libglfw3.a(cocoa_monitor.m.o) __glfwPlatformGetVideoMode in libglfw3.a(cocoa_monitor.m.o) __glfwPlatformGetVideoModes in libglfw3.a(cocoa_monitor.m.o) ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
I get these:
obj/x86_64Release/addons/ofxOpenNI/src/ofxOpenNITypes.o: In function `ofxOpenNIROI::set(ofVec3f, ofVec3f)':
ofxOpenNITypes.cpp:(.text._ZN12ofxOpenNIROI3setE7ofVec3fS0_[ofxOpenNIROI::set(ofVec3f, ofVec3f)]+0x1e5): undefined reference to `ofRectangle::set(ofVec3f const&, float, float)'
ofxOpenNITypes.cpp:(.text._ZN12ofxOpenNIROI3setE7ofVec3fS0_[ofxOpenNIROI::set(ofVec3f, ofVec3f)]+0x269): undefined reference to `ofRectangle::set(ofVec3f const&, float, float)'
obj/x86_64Release/addons/ofxOpenNI/src/ofxOpenNI.o: In function `ofxOpenNI::stop()':
ofxOpenNI.cpp:(.text+0x93ee): undefined reference to `ofThread::stopThread()'
collect2: ld returned 1 exit status
make: *** [bin/3DJ_Test] Error 1
I am using OF 0073 and OpenNI 2.0.0.29 Beta (Linux64).
hey there, love this addon - use it all the time.
need to have auto skeleton tracking so am using experimental branch. also need masks but in the experimental branch it always draws white for the transparent pixels, even after ofEnableBlendMode(OF_BLENDMODE_ALPHA) or ofEnabelAlphaBlending()
am I missing something? Also, it would be great to have a function to set the colour of the mask to something other than black.
cheers,
nay
hi there-
I followed your instructions = /ofxOpenNI is in /addons
/openNiSample007 is in /apps/devApps
It compiles and links and then can't find the kinect:
Init device...
Enumerate devicesstatus: Can't creat any node of the requested type
PrimeSense/SensorKinect/5.1.0.25failed : The device is not connected!
Found0devices connected
REAL Device could not be initialized...
Theo's ofxKinect had an upgrade to allow for the 1473 model. I think he just #ifdef'd the camera motor (not supported in the 1473 model). maybe we can make a similar change?
I'm using a 1473 model Kinect, and it works fine with the latest OpenKinect version. However, after following the install instructions, I'm still having a bit of an uphill battle with ofxOpenNI. Specifically, I can run the examples, and they can successfully detect skeletons and hands, but once they do so, the example crashes after 5-10 seconds. It's almost always a SIGABRT and happens at seemingly random points in the code. Would love to know if there are any easy tweaks that will get me functional. Thanks!
Please rename your "include" dir "libs" as per default OF hierarchy. The default makefile searches the libs dir for files from libraries.
See this snippet from the makefile:
ADDONS_REL_DIRS =
ADDONS_LIBS_REL_DIRS =
ADDONS_DIRS =
ADDONS_LIBS_DIRS =
ADDONS_BIN_LIBS_DIRS =
ADDONS_INCLUDES = $(ADDONS_DIRS)
ADDONS_INCLUDES = $(ADDONS_LIBS_DIRS)
ADDONS_INCLUDES +=
ADDONS_INCLUDES +=
ADDONSCFLAGS =
As you can see it only searches libs/ and src/
It will make it easier to get the addon running. :)
I noticed an issue with the hardware shutdown code. The claimed usb device isn't properly released, which causes issues when you create a new instance of the hardware layer without shutting down. Fix would be:
initialize the dev pointer to zero in the constructor.
adjust the shutdown code to contain the following:
if(dev != 0)
{
libusb_close(dev);
libusb_release_interface(dev, 0);
}
libusb_exit(ctx);
this closes & releases the dev handle properly
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.