I would like to use this code to kinect with Kinect because my codings are all in c++, and I realize that I would need openni.
VideoCapture capture( CV_CAP_OPENNI );
The problem is, I cannot find the latest guide installment for openni. When I do find some good guides, the links are dead. Can Anyone give me links for good openni installation in windows and in visual studio 2010? I would be very grateful.
VideoCapture capture( CV_CAP_OPENNI );
sounds like your using OpenCV built with OpenNI support. I recommend installing OpenNI first. Version 1.5.4.0 which you can find here works with OpenCV. I haven't tested OpenNI 2.0 with OpenCV yet.
You need to install 3 things in this order:
- OpenNI
- NITE
- Sensor Kinect (Avin's driver has the patch for Kinect, where as the default Sensor Driver is for Asus like sensors)
Once you've installed OpenNI and it works: PrimeSense drivers detects the device and you can run any of the OpenNI samples, like NiViewer
(in OpenNIInstallFolder/Samples/Build/Bin/..etc.)
you can choose to simple use the C++ OpenNI API or install and use OpenCV with OpenNI support.
You should built it from source and using CMake turn OpenNI support on.
Once that's built OpenCV with OpenNI support you can run the above code.
Here's a screenshot running ccmake
. It should very similar on Windows with CMake.
WITH_OPENNI
is ON
.
I've recently posted an OpenCV/OpenNI simple filtering example here.
来源:https://stackoverflow.com/questions/16754631/how-to-install-openni-in-windows-and-visual-studio-2010