webカメラで写真を撮る

 

apt-get install python-opencv

 

python2 で

import cv2

c = cv2.VideoCapture(0)

r, img = c.read()

cv2.imwrite('photo.jpg', img)