I feel like this might have been asked before but after spending some time jumping between places in the forum, I really didn't manage to get a clear answer... :/
I have been trying to get images from picamera as fast as I can in an opencv ready format, but currently I can't get past the 7/8fps... For 1280x720... I'm just not sure what I'm doing wrong. Have been trying to follow different tutorials, but just can't seem to get more than that. This is what I have currently... Does anyone have a better way of doing this? The code I currently have is below, but it isn't anything particularly fancy... and it's from some tutorials online. Any help would be more than appreciated!
I added threads in the middle which allows for more processing of the captured frames, but not to grab frames faster.
Code: Select all
with picamera.PiCamera() as camera: # initialize the camera and grab a reference to the raw camera capture camera.resolution = (width, height) camera.framerate = fps rawCapture = PiRGBArray(camera, size=(width, height)) # allow the camera to warmup time.sleep(2.0) # capture frames from the camera startTime = time.time() frameCounter = 0 for frame in camera.capture_continuous(rawCapture, format="bgr", use_video_port=True): image = frame.array *place image in a thread and process it in another place* rawCapture.truncate(0)