chrisla9
Posts: 21
Joined: Tue Aug 27, 2013 1:46 pm

raspistill - exposure

Thu Sep 19, 2013 5:29 pm

Has anyone had any luck with playing with the exposure setting using raspistill?

I've tried a few settings and the picture hasn't altered at all! Frustrating.

Here is the command line I'm using:

raspistill -w 1296 -h 972 -t 0 -ex night -e jpg -q 15 -o test
raspistill -w 1296 -h 972 -t 0 -ex auto -e jpg -q 15 -o test1
raspistill -w 1296 -h 972 -t 0 -ex verylong -e jpg -q 15 -o test2

Everything dark and horrible at 6pm but nice and light at 4pm :-(

Ultimate aim is to use it on a bird table or bird box so I need something with a long exposure time

Any help appreciated

Thanks

Chris

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

Re: raspistill - exposure

Thu Sep 19, 2013 9:52 pm

chrisla9 wrote:Has anyone had any luck with playing with the exposure setting using raspistill?

I've tried a few settings and the picture hasn't altered at all! Frustrating.

Here is the command line I'm using:

raspistill -w 1296 -h 972 -t 0 -ex night -e jpg -q 15 -o test
raspistill -w 1296 -h 972 -t 0 -ex auto -e jpg -q 15 -o test1
raspistill -w 1296 -h 972 -t 0 -ex verylong -e jpg -q 15 -o test2

Everything dark and horrible at 6pm but nice and light at 4pm :-(

Ultimate aim is to use it on a bird table or bird box so I need something with a long exposure time

Any help appreciated

Thanks

Chris
Try

Raspistill -t3000 -ex night

Night seems to a reasonably long time to build up the image.

Gordon77

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

Re: raspistill - exposure

Fri Sep 20, 2013 3:48 am

ednl wrote:
gordon77 wrote:Raspistill -t3000 -ex night
You must be on older firmware where that still works. A month or two ago it stopped working.
I only got the camera this week, downloaded the latest raspbian, did an update and an upgrade, is that old firmware ?

This is genuine question as l am confused exactly what you do need to do to get the latest firmware / software as raspbian is dated July.

Gordon77

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

Re: raspistill - exposure

Fri Sep 20, 2013 7:57 am

I cannot see why the update broke exposure. Weird. I hadn't been working in that area. Hopefully will get some time to look at it next week.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

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

Re: raspistill - exposure

Fri Sep 20, 2013 8:09 am

jamesh wrote:I cannot see why the update broke exposure. Weird. I hadn't been working in that area. Hopefully will get some time to look at it next week.
If you don't mind me asking...if the camera is a supported and marketted raspberry product why does it need you to do it in your spare time ?

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

Re: raspistill - exposure

Fri Sep 20, 2013 9:13 am

gordon77 wrote:
jamesh wrote:I cannot see why the update broke exposure. Weird. I hadn't been working in that area. Hopefully will get some time to look at it next week.
If you don't mind me asking...if the camera is a supported and marketted raspberry product why does it need you to do it in your spare time ?
Because the Foundation has no camera experts (or at least, people who know about this part of the code). Much of the stuff you see the Foundation bring out is done like this - they have only a very few employees, and there are working pretty hard on other stuff. Some of which is 'quite interesting' and should be announced soon...

I do occasionally get time at work to look at stuff like since the Foundation are a customer of Broadcom, but they are fairly low volume, so therefore a relatively low priority. I hope to get some time next week, as long as my Raspi monitor gets replaced, as it's gone titsup.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

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

Re: raspistill - exposure

Fri Sep 20, 2013 9:36 am

ednl wrote:
jamesh wrote:I cannot see why the update broke exposure. Weird. I hadn't been working in that area. Hopefully will get some time to look at it next week.
Thanks. Maaaaaaybe it's only an EXIF problem where the reported value is always the same but the actual setting does change? Or the setting does change but some sort of auto-compensation pulls the effective exposure back to a fixed value?

Although I do seem to remember images being darker in low-light all of a sudden, ie. after after a certain update.
There definitely seem to be a problem, I just don't know what I've done that may have caused it. Debugging on the GPU will be required which is a PITA.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

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

Re: raspistill - exposure

Fri Sep 20, 2013 12:00 pm

I tried and also see a problem that wasn't there before.

@jamesh, if you're diving into the exposure stuff on the GPU could you please take a look if manual exposure and white balance is feasible? Me and others are desperately waiting for that functionality since we can't use auto exposure and auto wb in our projects. Thanks. This also has an educational angle as learning photography with only auto modes is like learning programming with forced auto-complete ;-)

User avatar
wallarug
Posts: 460
Joined: Mon May 14, 2012 8:21 am
Location: Sydney, Australia

Re: raspistill - exposure

Sun Sep 22, 2013 7:50 am

I was wondering why my pictures where not coming out with the exposure settings. I knew that there was a problem but no clue how to fix it.

The best setting I found was the 'auto' exposure mode.

I was wondering how the 'fixedfps' mode worked. I thought it could be the manual exposure setting? Could someone please explain this to me?

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

Re: raspistill - exposure

Sun Sep 22, 2013 7:15 pm

wallarug wrote:I was wondering why my pictures where not coming out with the exposure settings. I knew that there was a problem but no clue how to fix it.

The best setting I found was the 'auto' exposure mode.

I was wondering how the 'fixedfps' mode worked. I thought it could be the manual exposure setting? Could someone please explain this to me?
It appears that auto is the only setting working correctly at the moment - I hope to look at this bug next week.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

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

Re: raspistill - exposure

Mon Sep 23, 2013 11:54 am

OK, think I have found the problem. For those that can rebuild the raspistill code...

change the line in the function raspicamcontrol_set_defaults in raspicamcontrol.c that sets the ISO to 400, and set it to 0 instead.

Would welcome feedback as to how well this fixes the issue.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

mikerr
Posts: 2774
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: raspistill - exposure

Mon Sep 23, 2013 1:29 pm

Changed the ISO default from 400 to 0 and after a quick compile here's the new version:

Code: Select all

-rwxr-xr-x 1 pi pi 49957 Sep 23 14:26 raspistill
Download it:

Code: Select all

wget https://www.dropbox.com/s/7g3ps83a2rrxtp0/raspistill
chmod a+x raspistill

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

Re: raspistill - exposure

Mon Sep 23, 2013 1:54 pm

mikerr wrote:Changed the ISO default from 400 to 0 and after a quick compile here's the new version:

Code: Select all

-rwxr-xr-x 1 pi pi 49957 Sep 23 14:26 raspistill
Download it:

Code: Select all

wget https://www.dropbox.com/s/7g3ps83a2rrxtp0/raspistill
chmod a+x raspistill
But is it better??????? (thanks Mike)
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

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

Re: raspistill - exposure

Mon Sep 23, 2013 3:52 pm

mikerr wrote:Changed the ISO default from 400 to 0 and after a quick compile here's the new version:

Code: Select all

-rwxr-xr-x 1 pi pi 49957 Sep 23 14:26 raspistill
Download it:

Code: Select all

wget https://www.dropbox.com/s/7g3ps83a2rrxtp0/raspistill
chmod a+x raspistill
Thanks Mike. I got it, but now what? I tried to copy it to first /usr/bin, then to /opt/vc/bin but it doesn't work. Had saved a copy of the original so I got it back to work again but I'd like to know where to put the new file...

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

Re: raspistill - exposure

Mon Sep 23, 2013 4:11 pm

Wherever you like (downloads folder?) - then run it using

./raspistill
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

thsBavR10
Posts: 233
Joined: Sat Jul 21, 2012 3:11 pm

Re: raspistill - exposure

Mon Sep 23, 2013 4:12 pm

Code: Select all

sudo cp raspistill /opt/vc/bin/raspistill

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

Re: raspistill - exposure

Mon Sep 23, 2013 4:32 pm

mikerr wrote:Changed the ISO default from 400 to 0 and after a quick compile here's the new version:

Code: Select all

wget https://www.dropbox.com/s/7g3ps83a2rrxtp0/raspistill
chmod a+x raspistill
Thanks! I can confirm that with this new version, ./raspistill -ex night -o test.jpg in a dark environment does indeed give me an ISO 800, 1/4 second exposure according to the EXIF tags, and the image looks somewhat noisy, so I think the EXIF tags are correct. As far as I can tell, -ex verylong still does not ever return (killed it after a few minutes). It also leaves something mis-configured, no further invocations of raspicam work until system is reset.

Setting both ISO 100 and also -ex night does not work; exposure stays at 66 msec (1/15 sec).

Code: Select all

[email protected]:~/camtest$ ./raspistill -ISO 100 -ex night -o test3.jpg
[email protected]:~/camtest$ identify -verbose test3.jpg | grep exif:ExposureTime:
    exif:ExposureTime: 65924/1000000
Last edited by jbeale on Mon Sep 23, 2013 5:36 pm, edited 1 time in total.

geekinthesticks
Posts: 97
Joined: Fri Feb 08, 2013 7:22 pm

Re: raspistill - exposure

Mon Sep 23, 2013 5:34 pm

On ArchLinux this gives me 0.25sec exposure and ISO 500 (from EXIF tags). Can also confirm that verylong never returns and causes the camera to lock up. Will do some more exepriments.

geekinthesticks
Posts: 97
Joined: Fri Feb 08, 2013 7:22 pm

Re: raspistill - exposure

Mon Sep 23, 2013 5:45 pm

Manually setting ISO as in:

Code: Select all

./raspistill -ex night -ISO 800 -o test_night800.jpg
Results in an ISO of 800, but an exposure of 1/20 sec and an underexposed picture. Don't know if this is expected behaviour. Maybe --ISO and -ex are mutually exclusive.

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

Re: raspistill - exposure

Mon Sep 23, 2013 5:52 pm

geekinthesticks wrote:Maybe --ISO and -ex are mutually exclusive.
I believe that is correct. The '-ex night' mode is enabled if and only if ISO is not explicitly set. The code bug that was just fixed, was the ISO getting set to 400 by default, instead of leaving it in auto-ISO mode.

Of course, many of us would like to be able to set all the controls including ISO and exposure time, to permit full manual exposure. That is apparently a project for another day. It seems the existing mobile-phone code base in the GPU camera code covers the common use cases, and full manual exposure control in a mobile phone is not a common use case.

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

Re: raspistill - exposure

Mon Sep 23, 2013 6:00 pm

Yes, with '-ex night -ISO 800' I get 1/25 while with only '-ex night' I get 1/4 (but also ISO 800!)

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

Re: raspistill - exposure

Mon Sep 23, 2013 6:30 pm

jbeale wrote:
mikerr wrote:Changed the ISO default from 400 to 0 and after a quick compile here's the new version:

Code: Select all

wget https://www.dropbox.com/s/7g3ps83a2rrxtp0/raspistill
chmod a+x raspistill
Thanks! I can confirm that with this new version, ./raspistill -ex night -o test.jpg in a dark environment does indeed give me an ISO 800, 1/4 second exposure according to the EXIF tags, and the image looks somewhat noisy, so I think the EXIF tags are correct. As far as I can tell, -ex verylong still does not ever return (killed it after a few minutes). It also leaves something mis-configured, no further invocations of raspicam work until system is reset.

Setting both ISO 100 and also -ex night does not work; exposure stays at 66 msec (1/15 sec).

Code: Select all

[email protected]:~/camtest$ ./raspistill -ISO 100 -ex night -o test3.jpg
[email protected]:~/camtest$ identify -verbose test3.jpg | grep exif:ExposureTime:
    exif:ExposureTime: 65924/1000000
Cool. Looks like a good fix for the exposure issue. I,ve pushed to userland github.

Not sure about very long though. I thought that worked for me.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

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

Re: raspistill - exposure

Mon Sep 23, 2013 6:45 pm

I agree verylong locks up my camera, and needs a reboot

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

Re: raspistill - exposure

Mon Sep 23, 2013 8:14 pm

If someone has time can you add the -ex verylong issue to the userland github bug tracker so I don't forget it. Ta.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

geekinthesticks
Posts: 97
Joined: Fri Feb 08, 2013 7:22 pm

Re: raspistill - exposure

Mon Sep 23, 2013 9:02 pm

If someone has time can you add the -ex verylong issue to the userland github bug tracker so I don't forget it. Ta.
Added to Github.

Return to “Camera board”