mark79
Posts: 10
Joined: Thu May 23, 2013 3:50 pm

Re: Long exposures

Tue Dec 24, 2013 12:54 am

rleyden wrote: I already tried the setting you suggested and it works somewhat better for twilight and is therefore useful for that. However, leaving the camera with that setting gives totally washed out daytime images. If it was mentioned in this thread how to get useful images with the full range of light conditions with one setting or script, I missed it. Is there such a setting?
See the sample script I posted above at: http://www.raspberrypi.org/phpBB3/viewt ... 47#p467547

This will step between automatic exposure with the night setting (which works fine in daylight) and the maximum exposure currently available using sports mode (with the longer shutter speed and timeout settings/trick). If you want to use this for a time-lapse with a more accurate interval, you'll need to set the time (before running raspistill) in a variable and compare against it rather than using the sleep 60 command in the script. Something like this would do the trick:

Code: Select all

#!/bin/bash

lightValueTimesTen=150
while [ true ]; do
   start=`date +%s`
   if [ "$lightValueTimesTen" -lt 15 ]; then
      timeout=10000
      exposure="sports --shutter 1000000"
   elif [ "$lightValueTimesTen" -lt 25 ]; then
      timeout=5000
      exposure="sports --shutter 800000"
   else
      timeout=5000
      exposure="night"
   fi
   outputfile="pi`date +%s`.jpg"
   raspistill --exposure $exposure --output "$outputfile"  --verbose --timeout $timeout
   lightValue=`exiftool "$outputfile" -LightValue | sed "s/.*: //"`
   lightValueTimesTen=`echo "$lightValue * 10" | bc -l | sed "s/\..*//"`
   next=`expr $start + 60`
   if [ "`date +%s`" -lt "$next" ]; then
     echo "waiting for next shot"
     while [ "`date +%s`" -lt "$next" ]; do
       sleep 1	
     done
   fi
done

Honsolgen
Posts: 20
Joined: Mon Nov 25, 2013 8:35 am
Location: Honsolgen - Germany
Contact: Website

Re: Long exposures

Tue Dec 31, 2013 12:50 pm

Any progress with longer exposure times?

For night shots it´s very much needed.
The current 1s. limit is very much a bad thing!

15s shutter time in combination with iso 100 would be great to see implemented.

Thanks!

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23968
Joined: Sat Jul 30, 2011 7:41 pm

Re: Long exposures

Tue Dec 31, 2013 12:56 pm

I'm getting to the point where I think it may not be possible without vast code changes. I gave up trying to get it past 1s as it simply didn't work. I think the underlying ISP code simply cannot handle the required registers settings to get longer exposures without extensive changes that I am not really the right person to do.

What I think is happening...the standard exposure registers can go up to about 1s. To make it go longer you have to start messing around with line and frame lengths, which I tried in the driver. But this confuses the ISP code, which does not expect line lengths to change for a particular mode, and prevents it from receiving frames correctly.

I will have a chat with the real expert on this stuff to see if there is any hope, but its not going to be quick whatever his opinion. It may even be a HW limitation.

It would be much easier if camera had a sensible single way of setting exposure time, rather than having to arse around with lines lengths to extend it.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

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

Re: Long exposures

Tue Dec 31, 2013 5:03 pm

Besides the things jamesh listed, there are inherent problems with high ISO and long exposures.

Regarding high ISO, as an example the Nikon 36MP D800 (among others) uses digital gain when shot over ISO 1600. With little light this means it's equal to raise the ISO further on the camera or up the exposure in the RAW converter using an under exposed ISO 1600 image. The latter is actually better when shooting RAW.

Equally when shooting longer than 1 second it has been demonstrated that a firmware fix from Nikon, meaning to reduce noise, erased stars that were visible with the former firmware. A better result could be achieved with dark-frame subtraction using the old firmware.

I don't mean to say that ISO 1600 and longer than 1 sec are hard borders, but the Pi Camera is an extremely cheap option considered the image quality in good light. Overall I'm impressed with the output and since I have used the RAW quite a lot I can see that there's already some very heavy wizardry going on in the normal jpeg output that's hard for me to mimic in post with RAW.

So I wouldn't keep my hopes up the IQ will be extended into either the extreme ISO or long exposure range using different camera firmware opposed to using Photoshop or the like on underexposed images.

But I'm not your typical 'expert' on these digital things ;-)

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23968
Joined: Sat Jul 30, 2011 7:41 pm

Re: Long exposures

Wed Jan 01, 2014 4:26 pm

One of these days I ought to write up something on the sort of processing the ISP does (bearing in mind what I can or cannot say in public!). I think it would make interesting reading for those who are into this sot of thing.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

Honsolgen
Posts: 20
Joined: Mon Nov 25, 2013 8:35 am
Location: Honsolgen - Germany
Contact: Website

Re: Long exposures

Fri Jan 24, 2014 10:17 am

Just a wish:
Any chance to implement at least the now maximum 1s exposure time into auto exposure mode as it allows continuous shots without adjusting daylight/night/dusk/dawn conditions with external programs and scripts.

Thanks

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: Long exposures

Fri Jan 24, 2014 7:54 pm

I think "--exposure night" goes to 1s now. I haven’t had the chance to try it out yet.

User avatar
jbeale
Posts: 3500
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Long exposures

Fri Jan 24, 2014 8:05 pm

Correct, with current firmware the "-ex night" option gives you very nearly 1 sec exposure in dark environments (I think it is approximately 0.97 seconds).

Honsolgen
Posts: 20
Joined: Mon Nov 25, 2013 8:35 am
Location: Honsolgen - Germany
Contact: Website

Re: Long exposures

Sun Jan 26, 2014 3:00 pm

I know, but that means I have the Pi calculate the day/night times and create cronjobs.
And during dawn / dusk another cron for handling this light conditions.

Correct auto exposure that can handle all scenarios from day/night/dawn/dusk is what I´ve asked for.

What´s the problem to have the auto exposure mode to handle exposure times up to 1s?
Should be possible to integrate this into auto mode.

Thanks,

BTW:
Why does -t xxxx influence correct exposure?
e.g. -t 0 is producing dark images, longer -t 1000 correct ones.
Even a -t 0 should give a proper image and not an underexposed photo.

the -t switch should not influence exposure at all!

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

Re: Long exposures

Sun Jan 26, 2014 3:17 pm

The camera works out exposure by taking frames and examining them. If you want good exposure with the first frame you need to know the correct exposure and use -ss and -ISO (full manual). For auto exposure you need a minimum of -t 500/750 in good light and fast shutter speeds, more if the shutter speed drops as there will be less frames coming in during the -t period.

What is the problem with using -ex night in daytime? I don't recall from my tests that the shutter speed is limited to something else than the minimum of 1/6173.

Honsolgen
Posts: 20
Joined: Mon Nov 25, 2013 8:35 am
Location: Honsolgen - Germany
Contact: Website

Re: Long exposures

Sun Jan 26, 2014 3:53 pm

well, but -ex night without the -ss does produce images up to 1s during night?
if not - what I guess will be the case - using -ex night during day does not change anything.
I will test this in a few hours.

Honsolgen
Posts: 20
Joined: Mon Nov 25, 2013 8:35 am
Location: Honsolgen - Germany
Contact: Website

Re: Long exposures

Sun Jan 26, 2014 5:40 pm

it is as I said:
at night condition executing -ex night without -ss does only produce images with a max. exposure time of 1/15sec.

Hence, using -ex night doesn´t change anything with the whole scenario.
-ex night -ss 1000000 will produce overexposed photos.

Why can auto exposure mode not streched to exp times of 1s?

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

Re: Long exposures

Sun Jan 26, 2014 6:52 pm

I think that was recently added, exactly to prevent your problem for needing scripts changing from day to night. Did you update?

Code: Select all

sudo apt-get update
sudo apt-get dist-upgrade
sudo rpi-update
Last time I tried -ex night (without -ss) gave me the 1 sec exposure.

Honsolgen
Posts: 20
Joined: Mon Nov 25, 2013 8:35 am
Location: Honsolgen - Germany
Contact: Website

Re: Long exposures

Sun Jan 26, 2014 8:35 pm

my Pi is up to date.

if I use:
raspistill -t 1000 -ex night
1s is used
Kamera-Hersteller: RaspberryPi
Kamera-Modell: RP_OV5647
Belichtungszeit: 1.000s
ISO: 1000
with -ISO xxx a max. exposure time of 1/20s is applied.
So, the trick is not using -ISO

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23968
Joined: Sat Jul 30, 2011 7:41 pm

Re: Long exposures

Mon Jan 27, 2014 9:32 am

Certain combinations will result in odd behaviour - and there's no point in trying to make the demo code work it all out and prevent combinations that don't make sense. All these settings interact in various way - setting ISO constrains the gain allowed, which then has an affect on shutter speed for example. The way all the settings interact is adjusted by exposure modes (for example, --night will have settings to try and reduce shutter speed but increase gain to keep the pictures half decent). It's why we cannot really easily add the 1s exposure to auto - the whole balance of settings would be thrown out.

So find a setting that works for you, and go with it.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

Honsolgen
Posts: 20
Joined: Mon Nov 25, 2013 8:35 am
Location: Honsolgen - Germany
Contact: Website

Re: Long exposures

Mon Jan 27, 2014 5:00 pm

Thanks james and poing.

It seems this line suits my expectation best for a correct 24h auto exposure:
raspistill -t 1000 -ex night -mm average -ev 8 -q 14 -ifx denoise -o current.jpg

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: Long exposures

Wed Jan 29, 2014 5:10 pm

Finally Arch has the firmware to test 1s limit in -ex night mode.

Looking at EXIF I only get ISO 1000 throughout a night-day cycle. But during the day it does not look like ISO 1000.

Pretty sure that before I got a range of ISO in EXIF with mosly ISO 100 and a ramp up at dusk. Is EXIF saving broken somehow?

Also the MakeNote tag that contain the diagnostics does not change in a timelapse series.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23968
Joined: Sat Jul 30, 2011 7:41 pm

Re: Long exposures

Wed Jan 29, 2014 5:21 pm

Hmm, I thought EXIF in timelapse was all working correctly. Sure I did a bug fix about 6 months ago.

Please report any issues on github so they don't get lost.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright


dren
Posts: 6
Joined: Mon Mar 17, 2014 8:54 pm

Re: Long exposures

Mon Mar 17, 2014 9:02 pm

Has anyone attempted to get long exposures of say, 2 seconds, by setting the pi up to take consecutive 1s pictures and then combining the images in post?

Would it be as simple as taking the raw data from two consecutive captures, adding it together, then post processing it using the techniques from in this thread?

If so, it's probably feasible to either extend raspistill with this capability or write a new app altogether.

Sanction
Posts: 5
Joined: Fri Jan 18, 2013 2:16 pm

Re: Long exposures

Wed Jul 16, 2014 9:47 am

Hi !
Is there any way to start a capture and trigger the stop of the capture ? In this case, we don't have the register size problem.
Sorry if this question is stupid, I didn't tried the camera yet, so I don't really know how the camera works. I will receive it soon. ;)

gordon77
Posts: 4248
Joined: Sun Aug 05, 2012 3:12 pm

Re: Long exposures

Wed Jul 16, 2014 9:57 am

Sanction wrote:Hi !
Is there any way to start a capture and trigger the stop of the capture ? In this case, we don't have the register size problem.
Sorry if this question is stupid, I didn't tried the camera yet, so I don't really know how the camera works. I will receive it soon. ;)
No, there is no way to start and stop a capture like this. You can either use Auto where it will set the exposure time or -ss and set a time upto 1 sec

gordon

raspindi
Posts: 6
Joined: Mon Jul 28, 2014 10:38 am

Re: Long exposures

Wed Aug 20, 2014 6:29 am

Hi,

just to sum the many different posts up, does that mean there is no "garantied" way to set the exposure time?
I am trying to write an indi driver for the camera, to use it as an astro-cam. The driver-api expects to set the exposure time....
I can of course experiment with different combination of settings and use them as "edjucated" guesses. But it would be much better if there was a way to define the exposure time (regardless of the amount of light in front of the cam).
Do any of you know a way to do that?

just for info about debayering, there seem to be different cameras out here! the normal debayering for the raspberry cam i have did end up with a purple image. After a long search i found that my cam seems to vflip automaticaly.... After changing the debayering accordingly the images where normal again..

raspindi
Posts: 6
Joined: Mon Jul 28, 2014 10:38 am

Re: Long exposures

Wed Aug 20, 2014 11:02 am

ok, this is obsolete. just now found the topic viewtopic.php?f=43&t=82306
So it can be done! great work! will try it this weekend.

Return to “Camera board”