[sugar] [OLPC-GSoC] GSoC Status Report: Vision Processing

Joel Stanley joel.stan
Sun Jun 29 22:31:18 EDT 2008

Hello Nirav,

On Thu, Jun 26, 2008 at 5:37 PM, Nirav Patel <nrpatel at gmail.com> wrote:
> functions to add.  Also, I only have the camera in the XO, vivi, and a
> poorly supported USB webcam, so if anyone could test it on other
> webcams, that would be great.

I've had a play with your work on my laptop - a ThinkPad with a webcam
supported by the out-of-kernel uvcvideo driver.  The demos you wrote
are cool, and it's fun being able to play with the webcam using just a
few lines of python.

It works well for the most part - I can use it to give me an image 9
out of 10 tries, but occasionally the process locks up, requiring me
to kill it (ctrl-c was ineffective).

I've been trying to reproduce the lockup today, but can't get it to
trigger.  I have been able to get the following to happen every 3 or
4th time:

$ python test.py
Traceback (most recent call last):
  File "test.py", line 10, in <module>
EnvironmentError: ioctl(VIDIOC_STREAMON) failure : 12, Cannot allocate memory

Occasionally when it succeeds, I will get a yellow tinted image.  Both
these errors have only happened in this session of testing; the other
night I ran it tens of times with only the lockup error.  I don't
think I've changed the version of pygame, I'm running git checkout

The python I used to test it is below. I'm new to pygame, and my
python knowledge is limited, so please point out any mistakes I'm

Sorry for the vague bug reports.  I'd be glad to help test any patches.



#!/usr/bin/env python

import pygame
from time import sleep
from pygame import camera


cam = camera.Camera("/dev/video0", (640, 480), "RGB")

frame = cam.get_image()

disp = pygame.display.set_mode((640, 480))
disp.blit(frame, (0,0))


More information about the Sugar-devel mailing list