I am useing next code for frame capture:
from picamera import PiCamera import utils
res = (1600,1600) camera = PiCamera(resolution = res) camera.resolution = res camera.raw_format = 'rgb' camera.framerate = 29 camera.iso = 800 camera.exposure_mode = 'off' camera.meter_mode = 'backlit' camera.image_effect = 'denoise' time.sleep(2.0) @utils.timeit def raw_frame(): stream = io.BytesIO() camera.capture_sequence([stream,],format="jpeg", use_video_port=True) return stream @utils.timeit def decoded_frame(stream): return cv2.imdecode( np.fromstring(stream.getvalue(), dtype=np.uint8), 1) @utils.timeit def get_frame(): return decoded_frame(raw_frame())
And the timings are
raw_frame - 0.187004089355s decoded_frame - 0.481935024261s get_frame - 0.670401096344s
Can anyone explain, from what exactly this time is come?
It takes almost 0.2s to get raw data from camera, that is 5fps, not ~30 as it should be. It can be ok, if the decoding will be fast, but I think it can't because of jpeg and image size.
If I use raw format, not jpeg, it takes almost a second to get the data. So, the question: is there any way to speedup the decoding, or to speed up capturing process? 1s for frame capture is too long.