title: Fastest Way to capture images for Processing Picamera
body: <p>I'm using the picamera module with the pi to capture images and process them, one at a time, with the openCV library.</p>
  
  <p>Currently I'm doing it like this at a 320x240 resolution (I can get about 30 images in the 20 seconds the loop runs);</p>
  
  <pre><code>while((now - start) &lt; 20):
          image_count+=1
          try:
              stream = io.BytesIO()
              camera.capture(stream, format='jpeg', use_video_port = True)
  </code></pre>
  
  <p>The fastest a capture, process cycle can elapse is around 500ms - the majority of this time is spent in the capturing. Ideally I'd like to get around 10fps and a higher resolution images.</p>
  
  <p>I've tried <code>capture_continious</code> before but when I convert my stream to a grey image it would break;</p>
  
  <pre><code>image= cv2.imdecode(stream, 1)
  grey_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) #continuous_capture breaks here.
  </code></pre>
  
  <p>I'd appreciate any insight into how to reduce this capture time as much as possible - ideally so that the processing becomes the limiting factor.</p>
  
  <p>Thanks!</p>