Ask Your Question

Revision history [back]

How to build openCV with openni2 (and make it work with a kinect XBOX 360) ?

Hello, OpenCV documentation has a "OpenCV and OpenNI" guide, the problem is that its content is old and can't be followed. I 'm trying to set this kinect so I can get depth "images". I can code only using C++ and I'd enjoy a tutorial/reference/guide that could help me out.

PS: I know how to build opencv using CMAKE, and how to set the flag "WITH_OPENNI2" , I have Openni2/64x installed, and I know how to link the openni2 and the opencv libraries to a project in visual studio.

Error message ---> [ INFO:0] VIDEOIO: Enabled backends(7, sorted by priority): FFMPEG(1000); GSTREAMER(990); MSMF(980); DSHOW(970); OPENNI2(960); CV_IMAGES(950); CV_MJPEG(940) OpenCV(4.1.0) Error: Unspecified error (OpenCVKinect2 : Couldn't set IR stream output mode: ) in CvCapture_OpenNI2::toggleStream, file D:\opencv-410\opencv-4.1.0\modules\videoio\src\cap_openni2.cpp, line 359 [ERROR:0] VIDEOIO(OPENNI2): raised OpenCV exception:

OpenCV(4.1.0) D:\opencv-410\opencv-4.1.0\modules\videoio\src\cap_openni2.cpp:359: error: (-2:Unspecified error) OpenCVKinect2 : Couldn't set IR stream output mode: in function 'CvCapture_OpenNI2::toggleStream'

ERROR! Unable to open camera

\ConsoleApplication3.exe (processo 12448) foi encerrado com o código -1.

![image description](/upfiles/1566444243640242.jpg)