ImageCapture from WebCam

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

ImageCapture from WebCam

narendra sisodiya-3
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

Image-SIG maillist  -  [hidden email]