Page 1 of 1

Possible to take pictures to RAM (without store it on SD)?

Posted: Fri Apr 21, 2017 6:52 am
by abramq
The picture would be processed after taking, so processing it into RAM would be faster. Is it possible to take the picture directly to RAM and modify it in RAM and then store modified picture to SD card?

Re: Possible to take pictures to RAM (without store it on SD

Posted: Fri Apr 21, 2017 7:00 am
by RaTTuS
yes - see the source for raspistill / raspivid and or mmal interfaces

Re: Possible to take pictures to RAM (without store it on SD

Posted: Fri Apr 21, 2017 7:06 am
by pootle
There are several ways to do this, but the simplest is to setup a small ram disk, and take the picture to this and then process it in whatever way you like.

Alternatively you can stream the image as rgb straight into an array (I use numpy, but it depends on what you want process it with) and then process it any way you want. rgb is good for this as it avoids introducing any compression artifacts before you start processing it.

Re: Possible to take pictures to RAM (without store it on SD

Posted: Fri Apr 21, 2017 8:42 am
by 6by9
pootle wrote:rgb is good for this as it avoids introducing any compression artifacts before you start processing it.
YUV is more efficient as that is the native format produced by the ISP, but it messes with people's heads that images can be represented in anything other than RGB ;)

Re: Possible to take pictures to RAM (without store it on SD

Posted: Sat Apr 29, 2017 2:39 am
by HypnoToad
/dev/shm/ is a ramdisk :)

Re: Possible to take pictures to RAM (without store it on SD

Posted: Sat Apr 29, 2017 5:30 am
by Gavinmc42
Or use a ram based OS like PiCore.
It boots from SD and runs in ram and only writes to SD card if you tell it to.

You can get the same effect in Raspbian if you know what you are doing :oops:
YUV is more efficient as that is the native format produced by the ISP
So streaming YUV would be more efficient too?
Reduced latency because no color space changes? google time