10 self._cam = cv.CreateCameraCapture(0)
13 for _ in range(5): #HACK
14 im = cv.QueryFrame(self._cam)
15 # Add the line below if you need it (Ubuntu 8.04+)
17 #convert Ipl image to PIL image
18 return Image.fromstring("RGB", cv.GetSize(im), im.tostring())
24 elif os.name in ('ce', 'nt', 'dos'):
26 from VideoCapture import Device
28 # TODO exception handling
32 self._cam.setResolution(640, 480)
35 return self._cam.getImage()