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

Re: raspistill - exposure

Thu Sep 26, 2013 4:13 pm

towolf wrote:
jamesh wrote: Are you sure? Are you talking about the ability to individually set custom gains for G and B (i.e. proper custom white balance)? I've never seen that except on DSLRs.
First hit on Google for Canon IXUS pdf manual

IXUS are 60-200 EUR P&S cameras
Interesting, would also be interesting to know if anyone has ever used that option! Still not going to implement it since for the very few people who would actually use it, it's not worth the considerable effort to add. If it ever gets put in mainline code by the core team, it might make it to the Raspi source tree, but at the moment that is extremely unlikely (due to Raspi tree being a year behind mainline in order to keep it stable)
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

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

Re: raspistill - exposure

Thu Sep 26, 2013 8:56 pm

A longer hysteresis would be enough for now. Suppose that is a constant.

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

Re: raspistill - exposure

Fri Sep 27, 2013 8:23 am

towolf wrote:A longer hysteresis would be enough for now. Suppose that is a constant.
Pretty sure that's possible - need to talk to a tuning expert. It's a GPU side code fix, nothing I can do on the ARM side.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

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

Re: raspistill - exposure

Mon Sep 30, 2013 12:51 pm

Just got back from holiday and was wondering what is now working and not working with raspistill.

From my understanding everything is ok with -ex with the exception of 'verylong' setting. Is that correct? and if so, can I download it from rpi-update?

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

Re: raspistill - exposure

Mon Sep 30, 2013 3:29 pm

wallarug wrote:Just got back from holiday and was wondering what is now working and not working with raspistill.

From my understanding everything is ok with -ex with the exception of 'verylong' setting. Is that correct? and if so, can I download it from rpi-update?
It may have now made it to rpi-update. I think Dom did release something over the weekend. Otherwise, just make the change and rebuild it yourself - it's a one liner.

-ex verylong works as long as the exposure doesn't go over about 1s. I'm currently trying to find out why. In fact, any operation which causes exposure to go over 1s (ish) may cause the lock up. Seems to upset the sensor somehow.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

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

Re: raspistill - exposure

Mon Sep 30, 2013 11:21 pm

jamesh wrote:
wallarug wrote:Just got back from holiday and was wondering what is now working and not working with raspistill.

From my understanding everything is ok with -ex with the exception of 'verylong' setting. Is that correct? and if so, can I download it from rpi-update?
It may have now made it to rpi-update. I think Dom did release something over the weekend. Otherwise, just make the change and rebuild it yourself - it's a one liner.

-ex verylong works as long as the exposure doesn't go over about 1s. I'm currently trying to find out why. In fact, any operation which causes exposure to go over 1s (ish) may cause the lock up. Seems to upset the sensor somehow.
ok, sounds good.

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

Re: raspistill - exposure

Tue Oct 01, 2013 7:14 am

I think recent changes I've made should now be on rpi-update - the -ex fix, plus a new feature in RaspiVid to allow the setting of the H264 profile.

The shutter time feature is a bity more convoluted and will require changes to the GPU and the ARM code, so will take a bit longer.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

seba
Posts: 5
Joined: Sat Mar 30, 2013 9:09 am

Re: raspistill - exposure

Wed Nov 27, 2013 10:08 pm

It freezes at above 0.35 s here.

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

Re: raspistill - exposure

Wed Nov 27, 2013 10:32 pm

Its up to about 2s with a change to the GPU firmware, but I was unsuccessful in getting it any higher and have run out of time for the moment.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

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

Re: raspistill - exposure

Thu Nov 28, 2013 1:54 am

Interesting- just did rpi-update, Linux raspberrypi 3.10.19+ #600 PREEMPT Sat Nov 16 20:34:43 GMT 2013 armv6l GNU/Linux
and this setting does work, it captures an image:

Code: Select all

raspistill -ISO 100 -ss 2000000 -t 2000 -o 2sec.jpg
The exif reports the shutter duration was only 0.973 sec, I'm not sure if that's actually correct, or not. The image appears nearly noise-free, but the dark regions are crushed to full black.

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

Re: raspistill - exposure

Thu Nov 28, 2013 9:38 am

Can you try without the ISO setting, I didn't think the firmware had been upgraded yet - but I'll ask Dom.

The EXIF is odd, but I wonder if my calculations for what the exposure actually is are wrong and its actually about 1s limit....Hmmm. Might be worth trying incrementing shutter values and cross references against the EXIF to see where it stops incrementing.

James
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

ethanol100
Posts: 648
Joined: Wed Oct 02, 2013 12:28 pm

Re: raspistill - exposure

Thu Nov 28, 2013 10:54 am

I can confirm there are some strange things going on...

But what is the right method to get the exposure time?
If I take pictures using: raspistill -v -ss 500000 -o fig.jpg

I get a almost complete white image(but we can see some details). What is the difference between ShutterSpeed and ExposureTime?
exiftool says: Shutter Speed=0.5 and Shutter Speed Value=0.5 and Exposure Time=0.5
identify -verbose says: ShutterSpeedValue=1000121/1000000 and ExposureTime=499958/1000000
So it seems to create pictures with 0.5s Exposure Time.

If I take pictures using: raspistill -v -ss 700000 -o fig.jpg
I get a complete black image.
exiftool says: 0.7s
identify -verbose says: ShutterSpeedValue=514655/100000 and ExposureTime=699960/1000000

If the firmware has not been upgraded, the good result is that the camera does not stop working, when the shutter speed is set over 0.3s.

If the -ss is set to values bigger than 1 exiftool always outputs 1s and identify something similar to 972724/1000000.

Edit 1: The images turning black are based on problems with the awb or something. If the whole image get maximal values(all 255), the output image is set to black(Somehow clear, how should the white balance work for one single value).I have put a grey filter in front of the camera and get pictures for all settings, but the shutter speed is visually limited to 1s of exposure, setting -ss to 1s, 2s and 5s delivers the same image.
Last edited by ethanol100 on Thu Nov 28, 2013 11:26 am, edited 1 time in total.

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

Re: raspistill - exposure

Thu Nov 28, 2013 11:22 am

OK, if its not crashing then the firmware has been released. But the black image sounds odd. I didn't get that in testing.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

ethanol100
Posts: 648
Joined: Wed Oct 02, 2013 12:28 pm

Re: raspistill - exposure

Thu Nov 28, 2013 11:31 am

It really seems to be just a problem for completely overexposed images. And the image quality for one second of exposure looks very nice.

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

Re: raspistill - exposure

Thu Nov 28, 2013 2:08 pm

ethanol100 wrote:It really seems to be just a problem for completely overexposed images. And the image quality for one second of exposure looks very nice.
Completely overexposed should be white...they were when I tested it.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

ethanol100
Posts: 648
Joined: Wed Oct 02, 2013 12:28 pm

Re: raspistill - exposure

Thu Nov 28, 2013 2:48 pm

Just three small same images( raspistill -w 320 -h 240 -ss 1000000 -o x.jpg):
1. Image taken out of my window
without_filter.jpg
without_filter.jpg (26.75 KiB) Viewed 5177 times
2. Added two crossed very cheap polarising filter (from 3d glasses)
with_filter.jpg
with_filter.jpg (61.71 KiB) Viewed 5177 times
3. -ss reduced to 500000 without filter
hell.jpg
hell.jpg (31.43 KiB) Viewed 5177 times
But I think it is not a big problem at all, a full white image is as useless as a black one.

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

Re: raspistill - exposure

Thu Nov 28, 2013 4:18 pm

I find the max shutter speed is now 0.97 sec. A value for -ss higher than 970000 has no effect.

With the following command I can get the ISO up to 1250:

Code: Select all

 raspistill -ss 980000 -o testss.jpg -t 2000 -ex sports
If I slowly raise the ISO like:

Code: Select all

 raspistill -ss 980000 -o testss.jpg -t 2000 -ISO 300
the image becomes white until the RGB values reach 254,255,253 (R,G,B) and then the image suddenly becomes completely black with values 0,1,0. Not really a problem but strange.

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

Re: raspistill - exposure

Thu Nov 28, 2013 4:29 pm

Hmm. That's odd. Obviously something wrapping around somewhere, but I would have expected an issue like that to have been reported years ago!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

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

Re: raspistill - exposure

Thu Nov 28, 2013 4:50 pm

poing on 29 Sep 2013 14:59 wrote: Also when using -ev +20 and up night and verylong tend to give completely black frames when the ISO starts to raise a bit.
http://www.raspberrypi.org/phpBB3/viewt ... 05#p429336

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

Re: raspistill - exposure

Thu Nov 28, 2013 5:54 pm

Made a quick python prog to step though shutter speeds and actual reported exif data:

Code: Select all

import os
from PIL import Image
from PIL.ExifTags import TAGS

def get_field (exif,field) :
  for (k,v) in exif.iteritems():
     if TAGS.get(k) == field:
        return v

lastexposure = 0

for ss in xrange(750 * 1000,4000 * 1000 ,100 * 1000):
   os.system('raspistill -o image.jpg -t 2000 -ISO 100 -ss ' + str(ss))

   image = Image.open('image.jpg')
   exif = image._getexif()

   exposure =  get_field(exif,'ExposureTime')

   print "Requested %s uS, actual %s" % (ss , exposure)

   if (exposure != lastexposure):
        lastexposure = exposure
   else:
        print "Max exposure reached"
        break

Results:

Code: Select all

Requested 750000 uS, actual (749952, 1000000)
Requested 850000 uS, actual (849968, 1000000)
Requested 950000 uS, actual (949984, 1000000)
Requested 1050000 uS, actual (972724, 1000000)
Requested 1150000 uS, actual (972724, 1000000)
Max exposure reached
so 972724 uS(microseconds)
(0.97 sec) is the max

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

Re: raspistill - exposure

Thu Nov 28, 2013 10:01 pm

OK, thank. I completely mistimed that one!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

seba
Posts: 5
Joined: Sat Mar 30, 2013 9:09 am

Re: raspistill - exposure

Sun Dec 01, 2013 7:23 pm

Updated today with rpi-update and it doesn't freeze anymore at 0.35 s. But exposure above 1 s doesn't seem to have any difference.

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

Re: raspistill - exposure

Sun Dec 01, 2013 8:37 pm

seba wrote:Updated today with rpi-update and it doesn't freeze anymore at 0.35 s. But exposure above 1 s doesn't seem to have any difference.
No, it appears approx 1s is going to be the max until I can figure out a way of extending the exposure without breaking the world.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

ethanol100
Posts: 648
Joined: Wed Oct 02, 2013 12:28 pm

Re: raspistill - exposure

Thu May 22, 2014 8:15 pm

After some complains about not getting 1s exposure in raspistill and raspivid (i.e. https://github.com/raspberrypi/userland/issues/175) I have done some tests.

Starting with the python script from mikerr I get the following output now:

Code: Select all

Requested 750000 uS, actual (749981, 1000000)
Requested 850000 uS, actual (771772, 1000000)
Requested 950000 uS, actual (771772, 1000000)
Max exposure reached
So it seems, that the maximum shutterspeed is now only 0.77s and not 1s?!

To confirm this I have created two images one with -ss 1000000 and one with -ss 771772 and they look exactly the same. I would argue, that not only the exif values are incorrect.

I have no idea how to check the actual exposure time in raspivid.

The string in the jpeg is for example for "-ISO 100 -ss 1000000 -t 60000"

Code: Select all

ev=-1 mlux=-1 exp=771772 ag=256 focus=255 gain_r=1.148 gain_b=1.570 greenness=-12 ccm=7844,-3146,-594,-1192,5750,-458,630,-3406,6882,0,0,0 md=0 tg=1371 1371 oth=0 0 b=0 f=1371 1371 fi=0 ISP Build Date: May 16 2014, 18:44:01 VC_BUILD_ID_VERSION: 3a67cfadce4d248b764d06dea2291917bc5db802 (clean) VC_BUILD_ID_USER: dc4 VC_BUILD_ID_BRANCH: dev
which seems to agree with the maximum exposure time of 0.77s.

But with the v4l2 module using:

Code: Select all

sudo modprobe bcm2835-v4l2
v4l2-ctl --set-fmt-video=width=2592,height=1944,pixelformat=3
v4l2-ctl --set-ctrl=exposure_dynamic_framerate=1
v4l2-ctl --set_ctrl=exposure_time_absolute=10000
v4l2-ctl --overlay=1
v4l2-ctl --stream-mmap=3 --stream-count=1 --stream-to=somefile.jpg
I get:

Code: Select all

ev=-1 mlux=-1 exp=999777 ag=2048 focus=255 gain_r=1.335 gain_b=1.445 greenness=16 ccm=5976,-1648,-228,-302,4522,-120,870,-1656,4890,0,0,0 md=0 tg=2324 2324 oth=0 0 b=0 f=2324 2324 fi=0 ISP Build Date: May 16 2014, 18:44:01 VC_BUILD_ID_VERSION: 3a67cfadce4d248b764d06dea2291917bc5db802 (clean) VC_BUILD_ID_USER: dc4 VC_BUILD_ID_BRANCH: dev
The v4l2 module is able to get the 1s shutterspeed.

Any ideas?

Update 1: If I use "raspistill -ex night -t 60000 -o foo.jpg" and cover the lense with my finger, I get the requested 1s shutter time(exp=999777). But adding -ss 1000000 to that command again limits the shutter speed to (exp=771772).

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

Re: raspistill - exposure

Fri May 23, 2014 7:20 am

ethanol100 wrote:After some complains about not getting 1s exposure in raspistill and raspivid (i.e. https://github.com/raspberrypi/userland/issues/175) I have done some tests.

Any ideas?

Update 1: If I use "raspistill -ex night -t 60000 -o foo.jpg" and cover the lense with my finger, I get the requested 1s shutter time(exp=999777). But adding -ss 1000000 to that command again limits the shutter speed to (exp=771772).
Interesting. I was having a quick play to try and get beyond 1s the other day, and I was also seeing exposure times maxing out at 770ms - I was using raspistill. I'll try to have a play again later.
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.

Return to “Camera board”