Working caprue func

This commit is contained in:
HeshamTB 2018-11-22 02:11:54 +00:00
parent 3f710e9ab3
commit 50bb02ab67

View File

@ -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)
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/')