0

I am very new to raspberry pi and python.
I am trying write a progam using python on raspberry pi to use the Kinect. I aim to install OpenKinect on Raspberry pi.
So far I have done:

apt-cache search OpenKinect
sudo apt-get install python-freenect
sudo apt-get update

Next i tried writing a code in python from this link https://github.com/OpenKinect/libfreenect/blob/master/wrappers/python/demo_cv_async.py

When i try to run the programe, it says that

error in line 5, 
import cv.
ImportError:no module named cv.

I am not sure if i have installed all the necessary files. I am also not sure what i have done wrong.
I also have been trying to look for tutorials on installing and using OpenKinect.

timss
  • 9,982
  • 4
  • 34
  • 56
user2306271
  • 31
  • 1
  • 4
  • i have tried following the steps in this website (http://www.neuroforge.co.uk/index.php/kinect-depth-map-with-python-and-opencv) however the following commands failed during my attempt `sudo add-apt-repository ppa:arne-alamut/freenect sudo python setup.py install` When i run freenect-glview, i get the following error messages `Number of deviced found:1 GL thread write reg 0x0105 <= 0x00 freeglut(freenect-glview): OpenGL GLX extension not supported by display ':o.o'` – user2306271 May 08 '13 at 07:38
  • Hey @user2306271 it looks like you're not an avid SOF user but I'm curious, did you make any headway with this?? – Jacksonkr Mar 05 '15 at 17:27

4 Answers4

1

Congradtulations on starting python! That sounds like a complicated project to start on. You should probably try doing the tutorial first at python.org. I particularily like the google video tutorials (if you are a classroom kind of person): http://www.youtube.com/watch?v=tKTZoB2Vjuk

After that you can dig into more detailed stuff :)

Garrett Berg
  • 2,585
  • 1
  • 22
  • 21
0

It looks like you still dont have opencv package for python. Try to install it:

sudo apt-get install python-opencv

Adam
  • 2,254
  • 3
  • 24
  • 42
  • I'm trying to install python-opencv. however i get error saying the packages are unable to be authenticated. and when i say install without verifications, it sys faild to fetch from http:/mirrordirector.raspbian.org/......... – user2306271 May 01 '13 at 05:53
  • Im, sorry i have solved the problem. i had forgot to log on to the internet – user2306271 May 01 '13 at 06:40
  • With regards to import frame_convert, i think i am suppose to write a code same as this link https://github.com/OpenKinect/libfreenect/blob/master/wrappers/python/frame_convert.py Now when i run the code openkinect code, i get an error (Depth:9107):Gtk-WARNING **: cannot open display – user2306271 May 01 '13 at 07:27
  • Do you have x server started? – Adam May 02 '13 at 11:00
  • i did not do -startx when i got that error. when i use startx, the program loads but no images appear. – user2306271 May 07 '13 at 03:33
0

The OpenGL or GTK-Warning: Cannot open display. Or the other one you stated Number of deviced found:1 GL thread write reg 0x0105 <= 0x00 freeglut(freenect-glview): OpenGL GLX extension not supported by display ':o.o' is because freenect does not support OpenGL. It probably uses EGL.

bmwesting (Brandt) wrote: "The freenect library provides a demo for the Kinect called glview. The glview program will > not work with the Pi because the program is written using OpenGL. The Raspberry Pi only supports GLES through EGL.

It seems like you will be able to use libfreenect to grab the depth stream and rgb stream, > but will be unable to run the demo program because it uses the incorrect graphics API."

If you read through that thread, it should show the alternatives (i.e. ASUS XTion instead of Kinect). They reach 30fps at high (~ 1024x800) resolution for depth data if using console output mode. I plan to go for Xtion now too - and I hope to get deactivate as much as possible from the USB bus (as this seems to be the bottleneck, for the Kinect too I think).

Radagast
  • 141
  • 1
  • 9
  • Thank you.. I think as it turns out kinect cant be used with the pi yet... i am now trying kinect with the beaglebone.. hope i will be able to succeed with beaglbone – user2306271 May 21 '13 at 13:39
0

When you install OpenCV using apt-get install python-opencv you are installing version 2. However, you can still use the methods from version 1 by doing so:

import cv2.cv as cv
guissoares
  • 404
  • 4
  • 11