takePhotos file

This commit is contained in:
HeshamTB 2018-11-22 04:27:34 +03:00
parent 9f75eda8a5
commit 3f710e9ab3

20
takePhotos.py Normal file
View File

@ -0,0 +1,20 @@
import numpy as np
from picamera import PiCamera
from time import sleep
def capture(numberOfPhotos, path):
try:
choice = input('Number of photos: ')
print('Initializing camera')
camera = PiCamera()
camera.resolution = (640, 480)
print('[ OK ] Camera')
sleep(2)
except:
print('[ Error ] Can not initialize PiCamera')
for i in range(0, numberOfPhotos):
camera.capture(path+i+'.jpg')
print('Captured '+str(i)'\nPath ('path+i+'.jpg)')
sleep(1)