How to install Openni in Windows and Visual Studio 2010?

别说谁变了你拦得住时间么 提交于 2019-12-02 10:16:10

问题


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.


回答1:


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:

  1. OpenNI
  2. NITE
  3. 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.

You don't need all the other settings exactly like mine, make sure 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!