I am using raspberry pi camera on CSI2 interface on Pi3. I have performance problems. I simplified the code to only capture module and it takes around 0.5 sec. What is the solution?

import time
import picamera
import numpy

with picamera.PiCamera() as camera:
    camera.resolution = (640, 480)
    camera.framerate = 24
    output = numpy.empty((480, 640, 3), dtype=numpy.uint8)
    while 1:
            camera.capture(output, 'raw')
  • Don't you need a start_preview before the sleep(2)? A warmup? – Gerard H. Pille Mar 9 '18 at 12:04
  • 1
    Captures from the still port implicitly switch the camera's mode to (and then from) one of the two image modes supported (of the 7 modes implemented, all support video capture but only two are used for still images). See rapid capture and processing for various hints on speeding up captures. – Dave Jones Mar 10 '18 at 19:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.