def capture_images():
global count
global frame
global camera_resolution
with picamera.PiCamera() as camera:
camera_resolution = camera.resolution
camera.shutter_speed = 100
time.sleep(0.5) #Shutter speed is not set instantly. This wait allows time for changes to take effect.
log.info("Initialized camera")
max_frames = args.max_frames
with picamera.array.PiRGBArray(camera) as stream:
for index, foo in enumerate(camera.capture_continuous(stream, format="bgr", use_video_port=True)):
if stopped is True:
return
count = index
log.info("Captured image. Starting to process...")
stream.seek(0)
stream.truncate()
frame = stream.array
log.debug("Converted data to array")
评论列表
文章目录