question framerates on picamera v2: according documentation of picamera , following framerates feasible hardware:
resolution aspect ratio framerates video image fov binning 1 1920x1080 16:9 0.1-30fps x partial none 2 3280x2464 4:3 0.1-15fps x x full none 3 3280x2464 4:3 0.1-15fps x x full none 4 1640x1232 4:3 0.1-40fps x full 2x2 5 1640x922 16:9 0.1-40fps x full 2x2 6 1280x720 16:9 40-90fps x partial 2x2 7 640x480 4:3 40-90fps x partial 2x2
however, when gathering images capture_sequence method (which in documentation referred fastest method) don't close these numbers.
for 1280x720 rate maxes out @ 25 fps, @ 640x480 maxes out close 60.
the calculations i'm performing irrelevant i.e. commenting them out doesn't make difference (calculations fast enough not cause of issue). if see flaws in i'm try , solve increasing framerate ... .
import io import time import picamera #import multiprocessing multiprocessing.pool import threadpool #import threading import cv2 #from pil import image referenceimage import referenceimage detectobject_stream import detectobject_stream collections import deque datawriter import datawriter backgroundimage=referenceimage() threadn = cv2.getnumberofcpus() pool = threadpool(processes = threadn) pending = deque() numberofimages=500 starttime=time.time() #datawrite=datawriter() #datawrite.start() def outputs(): stream = io.bytesio() start=true global backgroundimage in range(numberofimages): yield stream #print time.time()-starttime #start = time.time() while len(pending) > 0 , pending[0].ready(): timestamps = pending.popleft().get() #print timestamps if len(pending)<threadn: stream.seek(0) task = pool.apply_async(detectobject_stream, (stream.getvalue(),backgroundimage,start,0)) pending.append(task) start=false stoptime = time.time() print stoptime-start stream.seek(0) stream.truncate() #print picamera.picamera() camera: #camera.resolution = (640, 480) camera.resolution = (1280, 720) camera.framerate = 60 camera.start_preview() time.sleep(2) start = time.time() camera.capture_sequence(outputs(),format='bgr',use_video_port=true) finish = time.time() print('captured images @ %.2ffps' % (numberofimages / (finish - start)))
thanks in advance
Comments
Post a Comment