14henderson
Posts: 4
Joined: Tue Apr 28, 2015 10:01 pm
Location: Kent

Fast picamera image analysis

Sat Jul 11, 2015 1:50 pm

Does anyone know how to capture images from the picamera at fast speeds and convert it into a format that PIL can interpret? At the moment I'm using their suggested code (from http://picamera.readthedocs.org/en/latest/recipes1.html), but I can only get it to take an image every second - which is at least 10 times too slow for my needs. I'm sort of new to all this, so if you explain your answers as much as possible that would be much appreciated. :)

The code I'm currently using:
stream = io.BytesIO()
with picamera.PiCamera() as camera:
camera.start_preview()
camera.capture(stream, format='jpeg')
stream.seek(0)
image = Image.open(stream)

14henderson
Posts: 4
Joined: Tue Apr 28, 2015 10:01 pm
Location: Kent

Re: Fast picamera image analysis

Wed Jul 15, 2015 11:33 am

Maybe using the raspberry pi camera to stream a video recording and then taking frames from the stream would work? Someone help!

User avatar
davef21370
Posts: 897
Joined: Fri Sep 21, 2012 4:13 pm
Location: Earth But Not Grounded

Re: Fast picamera image analysis

Wed Jul 15, 2015 4:20 pm

Have a look here http://picamera.readthedocs.org/en/rele ... ipes2.html and scroll down to "Rapid capture and processing".
Maybe set up a RAM disk to make things quicker. Don't know about processing on-the-fly but this is a start.

Dave.
Apple say... Monkey do !!

User avatar
paddyg
Posts: 2555
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Fast picamera image analysis

Thu Jul 16, 2015 7:41 pm

Can you do the processing (or some of it) in numpy/scipy?
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

Return to “Python”