jpmerron
Posts: 3
Joined: Thu Jan 08, 2015 1:01 am

Settings for low light levels

Sun Nov 29, 2015 6:18 pm

Hello,

I am evaluating the RPi camera using raspistill with default settings and for normal daytime light levels the exposure time is adjusted depending on ambient light conditions to give good picture quality. However at dusk and dawn I would expect this to continue but the camera seems unwilling or unable to increase the exposure to greater than 1/8 second. I have tried different exposure modes (-ex ...) but I can't seem to get consistent improvement. I can force longer exposure times using -ss but that is not helpful since I need an automatic solution.

Am I doing something wrong or are there some 'tricks' to work around this?

Would appreciate some advice

Thanks.

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: Settings for low light levels

Sun Nov 29, 2015 10:22 pm

I think you need to use '-ex night' for the longest automatic exposure. Up to 2 seconds IIRC.

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

Re: Settings for low light levels

Sun Nov 29, 2015 10:38 pm

Night gives up to either 1 sec or 0.8s depending on how preview is run (preview can only go up to 0.8, but the stills mode can do 1s. Depends on the recomputation when it switches mode as to what level it goes up to).
6s is available, but only if you manually specify your exposure time and request a suitable frame rate, but you say you want an auto solution.
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.

User avatar
algorithm
Posts: 181
Joined: Mon Nov 25, 2013 9:09 pm
Location: Flatland

Re: Settings for low light levels

Wed Dec 02, 2015 10:04 am

Yes! I have this same problem. I want to use my camera as a view on my garden for the whole day & night but the only way I can now imagine automating this, is to add a light sensor and switch from auto to ss=2sec based on that (or even ss=variable dependent on light level). Which seems daft because the whole camera already is a light sensor.

I think both OP and I are talking about stills mode. Why does that 1 second limit exist for auto mode, is it hard-coded? But why?

User avatar
RaTTuS
Posts: 10365
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Settings for low light levels

Wed Dec 02, 2015 11:11 am

use sunwait to set a variable somewhere to say you're in day or night mode
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

User avatar
algorithm
Posts: 181
Joined: Mon Nov 25, 2013 9:09 pm
Location: Flatland

Re: Settings for low light levels

Wed Dec 02, 2015 11:43 am

RaTTuS wrote:use sunwait to set a variable somewhere to say you're in day or night mode
Right, I had thought about adding sunrise/sunset times from a table for my location, didn't know about this program. Thanks! Still would like to know about the 1 second limit though. EDIT: Also, sunwait and other time-based solutions would require an NTP connection or an RTC which I might not always have.

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

Re: Settings for low light levels

Wed Dec 02, 2015 12:01 pm

The sensor has one mode that runs at 1-15fps, and one that runs at 1/6-1fps. There is no automatic switching between them. Therefore you either have to request that your stills framerate is <1fps, or your maximum exposure time is 1 second.
See https://github.com/raspberrypi/userland ... ll.c#L1030 for setting the stills capture frame rate. You can get exposures <1sec from that mode, but you the step sizes are much larger.

If preview is running at the normal 1-30fps range, then I don't know how far the automatic algorithm will push things on a stills request.
If you drop preview to <1fps (RaspiStill.c line 969) then that will also use the 1/6-1fps mode and AE will probably select longer times for preview too. I just hope there aren't any arithmetic overflows in there - all the time calcs are in nsecs IIRC, so you 4.2secs would overflow a 32bit unsigned value.
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.

User avatar
algorithm
Posts: 181
Joined: Mon Nov 25, 2013 9:09 pm
Location: Flatland

Re: Settings for low light levels

Wed Dec 02, 2015 1:36 pm

6by9 wrote:The sensor has one mode that runs at 1-15fps, and one that runs at 1/6-1fps. There is no automatic switching between them.
Ha! Thanks for the explanation. For me, the output need only be 2 - 5 seconds per frame, old skool webcam type usage, so there would always be enough time.

Return to “Camera board”