Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a python openCV program that uses a webcam to track an image target. I switched computers, but this new computer does not have a webcam. I hooked up my kinect, installed stome stuff from OpenKinect.org (can now use glview), and would like to use the Kinect camera as a webcam for this program. How can I do this? The program I wrote is: http://pastebin.com/usspQXNU

share|improve this question
add comment

1 Answer 1

Newer kernels (3.0 or higher IIRC) support using the Kinect's RGB camera as a regular webcam. Suppose the Kinect camera is /dev/video0, you can run this command to get a video stream:

$ gst-launch-0.10 v4l2src device=/dev/video0 ! video/x-raw-yuv ! ffmpegcolorspace ! xvimagesink

That means OpenCV's highgui.cvCreateCameraCapture(0) should also just work (with 0 as the id for the Kinect camera).

You can check if the modules are loaded with this command:

$ lsmod | grep -i gspca
gspca_kinect           12936  0
gspca_main             28366  1 gspca_kinect
videodev               98259  2 gspca_main,uvcvideo 
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.