abramq
Posts: 83
Joined: Sat Jul 26, 2014 10:47 pm

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

Fri Apr 21, 2017 6:52 am

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?

User avatar
RaTTuS
Posts: 10506
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

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

Fri Apr 21, 2017 7:00 am

yes - see the source for raspistill / raspivid and or mmal interfaces
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

pootle
Posts: 340
Joined: Wed Sep 04, 2013 10:20 am
Location: Staffordshire
Contact: Website

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

Fri Apr 21, 2017 7:06 am

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.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7578
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

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

Fri Apr 21, 2017 8:42 am

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 ;)
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

HypnoToad
Posts: 77
Joined: Thu Dec 11, 2014 6:00 pm

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

Sat Apr 29, 2017 2:39 am

/dev/shm/ is a ramdisk :)

User avatar
Gavinmc42
Posts: 4069
Joined: Wed Aug 28, 2013 3:31 am

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

Sat Apr 29, 2017 5:30 am

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
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Return to “Camera board”