1

So for the last couple of days i've been trying to use my Kinect v1(1414) as a webcam for a project with OpenCV (Im using Ubuntu 16.04). I already installed Openkinect freenect (multiple times) and OpenNI, and i do get a video output when i run sudo freenect-glview. When I run lsusb it recognizes the camera and the motor.

Bus 001 Device 017: ID 045e:02ae Microsoft Corp. Xbox NUI Camera
Bus 001 Device 014: ID 045e:02b0 Microsoft Corp. Xbox NUI Motor
Bus 001 Device 016: ID 045e:02bb Microsoft Corp.

The problem comes when i try to use the camera as a simple webcam for python-OpenCV proyect. So, when in python i run cv2.VideoCapture(0), the console shows the following error:

[ WARN:0] VIDEOIO(V4L2:/dev/video0): can't open camera by index

So i read that using cv2.VideoCapture(-1) could work, but then the following error appears:

[ WARN:0] VIDEOIO(V4L2): can't find camera device

After searching for the error over internet people were saying that if i couldn't find v4l2src, then it was needed to install Gstream, so i did, tried with 1.0 and 0.10, but neither of those worked. I also tried running ls -ltrh /dev/video* but showed ls: cannot access '/dev/video*': No such file or directory or running v4l2-ctl --list-devices shows Failed to open /dev/video0: No such file or directory

In the end, i figured out that i needed to find a way to make the camera be recognized by the system (dev/video0).but until now, i haven't been able to succeed, so now i come to you asking if anyone has had the same problem before and/or if you know how to solve it.

Thanks in advance.

1 Answer 1

1

So i could finally solve this problem. What you need to check is the following:

If running -ltrh /dev/video* shows ls: cannot access '/dev/video* so you need to "reset" gcspa_kinect (Apparently freenect doesn't let it to be used after yopu run for example freenect-glview. "REsetting" this is done the following way:

sudo modprobe -r gcspa_kinect and then sudo modprobe gcspa_kinect.

If you run -ltrh /dev/video* again, it shows a recognized device. Now you can use for example Cheese to verify that the camera is working.

If you run freenect-glview again then you'll need to repeat the process.

If anyone knows how to make a permanent solution of how to get the camera recognized by the system as a webcam and still being able to use freenect that would be great!!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .