well, I found there/s already a great addon of ofxMSKinect by simon.
I am happy if some of you might like this also.
– I tried to make the similar APIs as ofxKinect.
– You can grab Video/ Depth/ Label (silhouette)/ Skeleton and CalibratedRGB (adjust video pixels to depth pixels)
– You can capture/ playback them.
– You can change tilt angle of kinect elevation.
– Use addKinectListener if you want callback when kinect is plugged/ unplugged.
– You can use 2 or more kinects (only 1 kinect is allowed to grab Label/ skeleton), note that you have to use the different usb controller on each kinect. @seehttp://bit.ly/oG8Hwk
– I implemented near/ far threshold of depth images so that you can use them with OpenCV.
(it may be better to use Label pixels if you want only players’ data for CV.)
– Sorry it/s only for windows + vs2010 'cause Kinect SDK requires them, but I want to wrap OpenNI (+Xtion also) in future for mac/ linux users.
** NOTE **
I know this still contains many bugs, please let me know if you find.
the main bug is that you can’t close app with ‘esc’ key or press ‘x’ button of oF window once after kinect is detected.
I/m trying to fix it now, but please press ‘x’ button of console window to close for now.
Would somebody please help me to solve the problem of closing window?? : (
still I don’t know why impossible to close window with Esc key or close button of main window…
update to ver. 0.02. : )
changed pixel data to OF style: ofPixels instead of unsigned char*, etc…
Images above are depth images clipped to 700-1700mm(you can change/ save range), thresholded depth images and contours using ofxOpenCV from it.
Images below are label(users) images, thresholded label images and contours using ofxOpenCV from it.
Differences between them are:
Depth images detect not only users but also chairs, cats etc… label images detect users only.
When users are overlapped, whole contour will be detected from depth images but you can get separated/ each user’s or whole contour from label images.
You have to wait maybe 0.5-1 sec for Kinect to detect users labeled data. A user has to be on proper distance from Kinect to detect him/ her.
You can clip distance range only with depth images.
So, if you want to focus on users detection, I recommend you to use label images for cv. And if you don’t need users detection or you need non-user detection, you’d better to use depth images.
Thx!!
Sorry, this time VS only. but I want to make it compliant with code::blocks.
I will try after I implement kinect audio part. Or I’m happy if there’s someone try that. : )
near mode is now available (only for Kinect for Windows hardware)
NOTE: You can’t get skeleton data on near mode. you can get only center position which is now implementing.
compliant with audio input. ‘exampleAudio’ added.
Though example is pretty bad, i deside upload this 'cause I don’t want you to wait. : )
You can record (16kHz/ 16bit/ mono) wav file when press ‘R’.
This version you should shutdown app to hear the audio file.
(It seems CloseHandle(HANDLE hFile) make the sound file like crazy… now I researching this problem)
Anyways I will update this example soon so some of the functions around audio would be changed.
calibratedVideo (for point cloud) sample is a little bit changed.
press ‘Q’ on sample app to check
Please let me know if you like it or find any bug. : )
I’m able to compile it and run it, but I’m having a very strange behaviour, when I run the .exe directly, is showing a lot of errors like the screenshot attached, and then crashes… but if I run the application from Visual Studio, then is working fine.
Does anyone found something like this? I’m trying to find what could be the issue with no luck!
I changed my program to use your addon instead of ofxKinect to try out and is compiling fine, but works only in debug mode, I don’t know why but it crashes when I compile in release mode (it crashes always in the kinect.update() statement). Anyways it should be something in my app, because both examples from your addon work fine in debug & release.
Thanks for putting this together Sadam. Really great work.
I’m trying to use it for a project but having a nightmare setting it up. This is my first serious attempt to work with the VS2010 OF version. I’m using Visual C++ express.
Trying to compile the application led to a series of errors stating that NuiApi.h could not be found. I added “C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc” to Configuration Properties -> VC++ Directories -> include directories. This fixed the missing NuiApi.h issue but now I’m getting:
fatal error LNK1104: cannot open file ‘Kinect10.lib’
I tried adding “C:\Program Files\Microsoft SDKs\Kinect\v1.0\lib\x86” and “C:\Program Files\Microsoft SDKs\Kinect\v1.0\lib\x86” separately but this didn’t fix it.
Any idea where I might be going wrong here?
I have a couple of ideas but can’t see a way round. Firstly, the Kinect SDK seems to have installed to the 32-bit Program Files folder. Secondly, I learned here:
that Visual C++ can’t compile a 64 bit app unless the Windows SDK version 7.1 is installed (and a couple of changes to the project settings are made). I tried this but there were errors saying that FOUR_CHAR_CODE (used in OF) wasn’t recognised. I removed the Win SDK and reset the project and this error went away.
PC Spec:
64-bit Windows 7
3.1 GHz Quad Core processor
4 GB RAM
I’m using the addon right now and it worked pretty much out-of-the-box… I took screenshots of all my paths, maybe one of these isn’t set properly in your project.
Make sure the Kinect environment variables are set to
C:\Program Files\Microsoft SDKs\Kinect\v1.0\
Then make sure the paths are added for compiling and linking.
(BTW, I can’t believe it’s still this complicated to take screenshots on Windows…)
However, it seems to work today even though I haven’t changed anything. So I’m experiencing the usual mix of relief and worry - mostly relief though
The frame rate seems to be very low for both sample projects (5fps for skeletal example and 12fps for cv example). I’ve tried opening both on 2 PCs with simlar results. The PC mentioned above has an NVIVIA Quatro 600 graphics card and the second PC has the following spec:
64-bit Windows 7
3.3 GHz Quad Core processor
8 GB RAM
Inter® HD Graphics Family
Any thoughts on why this is so slow? It’s a bit of a show stopper.