Long exposure based on historgram - Script Writing - CHDK Forum supplierdeeply

Long exposure based on historgram

  • 5 Replies
  • 4488 Views
Long exposure based on historgram
« on: 01 / February / 2009, 11:41:01 »
Advertisements
just extending this conversation to others. i've been working on the night time lapse script and i've become curious about what it would take to create a script which does long exposure by examining the histogram.

from a private message with fudgey -

Quote from: mattkime on Today at 07:34:56
I'm curious what kind of algorithm you'd suggest for regular photography. while i'm fairly experienced as both a photographer and a programmer, the idea of judging proper exposure based on a histogram intimidates me.

Hmm... haven't thought about that... and haven't really dug into what sort of data that histogram dump gives us. This should be a public thread.

But if you can turn the histogram data into a measure of approximate underexposure in matter of exposure value, maybe it would suffice to do something like

1) use and automatic mode (Av or P in a570is) with flash disabled and half shoot. Read which Tv camera wants to use.
2) If Tv is less than 1 second, shoot, end. No need for any special tricks since Canon autoexposure is still working.
3) If Tv => 1 second (longest exposure Canon autoexposure can decide is 1s in all cameras AFAIK), enable histogram capture and shoot.
4) Check histogram. Determine how much it's underexposed, shoot with increased Tv.
5) Check histogram. If it's overexposed, adjust and reshoot. If it's underexposed more than a set threshold (such as 2 Ev; maybe the threshold should vary with length of exposure so that longest exposures are given some more slack since they take lots more time to repeat).

Very dark scenes will only have noise in the 1 second exposure. I don't know what sort of a histogram that results in. Needs a whole lot of experimenting.

*

Offline fbonomi

  • ****
  • 469
  • A570IS SD1100/Ixus80
    • Francesco Bonomi
Re: Long exposure based on historgram
« Reply #1 on: 02 / February / 2009, 16:44:31 »
While studying the sun-set timelapse, I have studied a bit (with no great result) the histogram one gets from the RAW data.

My first idea was to implement a "night auto exposure" that would be able to meter luminosity even when it was too dark for the the "live" sensor.

My idea was to shot a first (disposable) image with very high ISO and rather short exposure (for example, 1" at ISO 3200).

Then, I would analyze the histogram of the image I obtained, for example determining that it was over-exposed by 2 stops, then do something like the following:

1" ISO 3200 is equivalent to:
2" ISO 1600
4" ISO 800
8" ISO 400
16" ISO 200
32" ISO 100

The image I shot is overexposed by 2 stops, so the "correct" exposure is 8" ISO 100.

This has proven rather hard for a series of reasons.

First of all, it's an histogram of RAW data (before linearization etc.) so not that easy to compare with the histograms we are used to have

Second, and most important, in a night shot deciding what is "over" and what is "under" exposed is much a subjective matter.

For example, in certain scenes the "nice" image is almost black, in order to preserve the night-like aspect. If we were to judge the scene just by the histogram, that histogram would be an histogram of a largely under-exposed shot.

If we increase the exposure so that the histogram becomes more "centered", the scene receives a very strong luminosity, and becomes similar to a normal, daylight shot. But his means that if there are artifical light in the scene they will be completely "burnt" in order to get an average exposure.

The only case where this could work well are cases where there are absolutely no artificail lights (like for example a moon-lit countryside landscape): in these case exposing the scene to get a day-like luminoity gives a decent (albeit innatural) result: the fields are lit, the sky is no longer black, etc.

If you think about it, most night-time photography is all about deciding "how much can I over-expose the highlights in order to get some detail in the shades?"

Re: Long exposure based on historgram
« Reply #2 on: 02 / February / 2009, 16:54:35 »
Even if your approach isn't a perfect solution for the problem, i would still like to see it implemented.

i think its rare that there is a problem with "over exposing" night. you need to over expose to get detail. then you darken the image to match the appearance of night.

at least thats how it works with analog. not sure how working with digital would compare.

Re: Long exposure based on historgram
« Reply #3 on: 02 / February / 2009, 19:53:49 »
I'm not sure if this is really relevant to what you want to do, but Cyril42e has written a script "Long exposure night shot" that works really well when trying to get good exposures at night.  The script is found at the follwing link from the UBASIC/Scripts page:

http://crteknologies.free.fr/wiki/doku.php/photo:chdk-scripts

I could be well off the mark, but this has been very useful to me in the past.
IXUS 70 (SD1000)
Powershot G9


*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Long exposure based on historgram
« Reply #4 on: 03 / February / 2009, 12:54:05 »
I'm not sure if this is really relevant to what you want to do, but Cyril42e has written a script "Long exposure night shot" that works really well when trying to get good exposures at night. 

Good point, I had forgotten about that script. It is relevant in the sense that it's faster than shooting for histogram and as such it is an alternative in a range where the camera would want to stick to 1 s but the LCD still has some information (maybe thanks to AF lamp) to decide scene luminance from.

It would be nice to know how dark that script can be used successfully (it's likely that this is camera model dependent due to differences in SNR of live view images). It can't possibly work well for the darkest scenery shots, can it?


What fbonomi says is correct but I also agree with mattkime here... the camera can't decide whether to shoot a bright day-like photo or a realistic dark one, that's something that will have to be left to the user. The script can always have presets or mere ev correction parameter for the user to input how bright/dark shots are desired. But if the script can shoot similarly exposed images from different scenes at night, it's a success. The user will quickly learn what sort of images a certain setup will result in, and will get the shots (s)he desires easier and/or faster than by trying out several exposures manually.

Re: Long exposure based on historgram
« Reply #5 on: 03 / February / 2009, 12:58:11 »
does anyone have experience looking at histogram readings from high ISO images, particularly at low light levels? i wonder if the noise would be a problem.

still, the idea of exposing at higher ISOs to judge light levels is worth investigating.

 

Related Topics