Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 (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:

share|improve this question

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

Your Answer


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.