简体   繁体   中英

Capturing frames from macbook isight with PIL

I'm trying to write an app using python and PIL that involves processing frames from my macbook camera. Is there an easy way to capture frames from the iSight for use with PIL without installing too many libraries?

I've seen a few questions on SO about doing this with OpenCV, which I don't want to do. Can I do this without using OpenCV as I've had trouble installing that?

Maybe you can try using the SimpleCV library. After installing it, the following code should work:

from SimpleCV import Camera
from SimpleCV import Image

webcam_camera = Camera()
webcam_image = webcam_camera.getImage()
webcam_image.save("frame.jpg")

Although OpenCV would be a much better option. If you follow the instructions on their website, it wouldn't be too hard to get it up and running.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM