diff --git a/takePhotos.py b/takePhotos.py index f1654b2..2e1974d 100644 --- a/takePhotos.py +++ b/takePhotos.py @@ -4,17 +4,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) \ No newline at end of file +def capture(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, choice): + camera.capture(path+str(i)+'.jpg') + print('Captured '+str(i)+'\nPath ('+path+str(i)+'.jpg)') + sleep(1) + +capture('test/') +