Go to advanced search

by Gelu
Mon Mar 23, 2015 5:41 pm
Forum: Camera board
Topic: Pure Python camera interface
Replies: 462
Views: 178821

Re: Pure Python camera interface

Many thanks for your explanations, I just want to use the video port, so I've tried running just the last part of the code and it works fine.
by Gelu
Mon Mar 23, 2015 3:19 pm
Forum: Camera board
Topic: Pure Python camera interface
Replies: 462
Views: 178821

Re: Pure Python camera interface

Is it possible to use the video port with picamera.array? I posted this question in another forum but it was buried in another post and did not receive much attention... (at the end of: http://www.raspberrypi.org/forums/viewtopic.php?f=32&t=104368&p=721252#p721252) Sorry if it not correct to repost ...
by Gelu
Thu Mar 19, 2015 10:46 am
Forum: Python
Topic: picamera rapid capture and processing
Replies: 10
Views: 15875

Re: picamera rapid capture and processing

OK, for the records, all of the above was documented in: https://picamera.readthedocs.org/en/release-1.9/recipes2.html#unencoded-image-capture-rgb-format (shame on me for not reading slow enough...) but I have another problem here!! (and it seems related to your comment on the jpeg compression). Whe...
by Gelu
Thu Mar 19, 2015 8:55 am
Forum: Python
Topic: picamera rapid capture and processing
Replies: 10
Views: 15875

Re: picamera rapid capture and processing

ummm, I would expect the code I wrote to be as fast as the picamera.array (basically because it is the same code). It is definitely faster than the jpeg conversion (as the original recipe stated). I've done some timing and that is the case, jpeg>picamera.array=np.frombuffer going through jpeg is slo...
by Gelu
Wed Mar 18, 2015 7:22 pm
Forum: Python
Topic: picamera rapid capture and processing
Replies: 10
Views: 15875

Re: picamera rapid capture and processing

OK, doing: stream = io.BytesIO() start = time.time() camera.capture(stream, format='bgr') # I have got this code from picamera array.py : # class PiRGBArray(PiArrayOutput): # Produces a 3-dimensional RGB array from an RGB capture. # Round a (width, height) tuple up to the nearest multiple of 32 hori...
by Gelu
Wed Mar 18, 2015 6:43 pm
Forum: Python
Topic: picamera rapid capture and processing
Replies: 10
Views: 15875

Re: picamera rapid capture and processing

I guess that frombuffer is the way to go, looking at the code in class PiRGBArray I get the definition as: def flush(self): super(PiRGBArray, self).flush() self.array = bytes_to_rgb(self.getvalue(), self.size or self.camera.resolution) and then : def bytes_to_rgb(data, resolution): """ Converts a by...
by Gelu
Tue Mar 17, 2015 9:25 pm
Forum: Python
Topic: picamera rapid capture and processing
Replies: 10
Views: 15875

Re: picamera rapid capture and processing

Thanks, Yes, the second example you mention in https://github.com/waveform80/picamera/blob/master/docs/recipes1.rst#capturing-to-an-opencv-object is what I was attempting to use (it is the second part of code in my first post above). The problem is that I don't know how to incorporate the "with pica...
by Gelu
Tue Mar 17, 2015 7:10 pm
Forum: Python
Topic: picamera rapid capture and processing
Replies: 10
Views: 15875

Re: picamera rapid capture and processing

Thanks for the input. I have tried modifying the jpg argument to bgr but it seems I am not able to convert the stream to a correct numpy array, i.e if I do: stream2 = io.BytesIO() camera.capture(stream2, format='bgr') # Construct a numpy array from the stream data2 = np.fromstring(stream2.getvalue()...
by Gelu
Tue Mar 17, 2015 1:38 pm
Forum: Python
Topic: picamera rapid capture and processing
Replies: 10
Views: 15875

picamera rapid capture and processing

I am using the raspberry pi with the picamera and opencv python modules trying to do some rapid capture and processing. Currently I am using the recipe in http://picamera.readthedocs.org/en/latest/recipes2.html#rapid-capture-and-processing to capture each image to a BytesIO stream. Then I have added...
by Gelu
Tue Nov 04, 2014 2:37 pm
Forum: Camera board
Topic: Takin images of particles in a fast flow
Replies: 6
Views: 1278

Re: Takin images of particles in a fast flow

Thanks. Yes, well spotted, I should have looked to the later pictures, the first images are low quality but later ones are much better (even with the original raspvid command).
Thanks!!
by Gelu
Tue Nov 04, 2014 11:08 am
Forum: Camera board
Topic: Takin images of particles in a fast flow
Replies: 6
Views: 1278

Re: Takin images of particles in a fast flow

Hi, Thanks for your very detailed explanation. I have tried using the png format (and also your options for the jpeg) and I get very similar (poor quality) results. I have tried to upload an example, hope that you can see the image: http://imageshack.com/a/img538/3198/rc12gI.png As for the exposure ...
by Gelu
Thu Oct 30, 2014 11:24 am
Forum: Camera board
Topic: Takin images of particles in a fast flow
Replies: 6
Views: 1278

Re: Takin images of particles in a fast flow

Thanks for your message. I have been reading about the bitrate and as far as I could understand it only affects the video recording, am I right? If that is the case, I haven't seen any improvement by giving different bitrates to the raspivid command. It seems that I can record video at a fast enough...
by Gelu
Tue Oct 28, 2014 3:13 pm
Forum: Camera board
Topic: Takin images of particles in a fast flow
Replies: 6
Views: 1278

Takin images of particles in a fast flow

Hi, I am a biologist and I want to use the Raspberry Pi camera to take pictures of organisms (lets call them particles) in a flow of water that it is passing in front of the camera. The particle concentration is variable but I would expect that at around 15fps every particle would be imaged. Each sa...

Go to advanced search