[Image-SIG] ImageCapture from WebCam
Narendra Sisodiya
narendra at narendrasisodiya.com
Sat Jan 8 06:44:39 CET 2011
I am using following code. I am using opencv, It is Okey or is there any
scope for improvement !
Anything faster ? I am processing images using PIL
import Image
import sys
import opencv
import time
#this is important for capturing/displaying images
from opencv import highgui
camera = highgui.cvCreateCameraCapture(3)
def get_image():
im = highgui.cvQueryFrame(camera)
# Add the line below if you need it (Ubuntu 8.04+)
#im = opencv.cvGetMat(im)
#convert Ipl image to PIL image
return opencv.adaptors.Ipl2PIL(im)
--
┌─────────────────────────┐
│ Narendra Sisodiya
│ http://narendrasisodiya.com
└─────────────────────────┘
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/image-sig/attachments/20110108/9c16605c/attachment.html>
More information about the Image-SIG
mailing list