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

asked 2019-08-21 22:26:34 -0500

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)
edit retag flag offensive close merge delete


Best of luck. I didn't have luck with the OpenNI software. I ended up using the Kinect 1.8 SDK instead:

sjhalayka gravatar imagesjhalayka ( 2019-08-22 12:21:11 -0500 )edit