As a crash course in learning the basics of Pygame, I wrote a quick little Activity for the OLPC XO. It is a clone of xeyes, except instead of following the mouse cursor, it uses the webcam to be creepy and follow your face. It’s a bit slow, and kind of messy, but I did only make it for learning purposes.
It uses OpenCV, so you’re going to need a version of it that works on the XO. The latest source from CVS works, or you can install a patched rpm of it that I hacked together:
sudo rpm -i https://eclecti.cc/files/opencv-1.0.0-3olpchack.fc7.i386.rpm
You’ll also need the opencv-python package, which is available in the repository.
sudo yum install opencv-python
You can get the .xo itself here: PyEyes-1.xo
8 Replies to “PyEyes: xeyes in Python with Face Tracking”
would you mind uploading the source in a tarball? myself and some friends (listed at my webpage) wanted to run this on x86 which should not be a problem except that I dont’ understand the .xo pacakge format to get the python code
thanks in advance
A .xo is basically a .zip. You can open it with unzip on linux or any zip program on Windows (though you may need to rename it to .zip on Windows, I don’t know).
The directory structure of the .xo is a bit weird, but the only part you need to run it on something that isn’t an OLPC is run.py.
The dependencies are pygame and opencv-python. It’s really a very simple script. You’re going to need to adjust some of the parameters to make it look right depending on where you put the webcam. You could also use some trig for pupil placement, which I was too lazy to do.
Ah thanks… ran run.py got this
Traceback (most recent call last):
File “./run.py”, line 56, in ?
File “./run.py”, line 11, in main
capture = cvCreateCameraCapture(0)
NameError: global name ‘cvCreateCameraCapture’ is not defined
well i have python2.4 and python-opencv installed on debian etch … i don’t have a camera to make sure that is noth the problem … I’ll have a chance to test it next week i think
It works great
keep up the good work there 🙂
¿Como instalo OpenCV en XO?
How to install OpenCV in XO