Mult-Exposure Bracketing Based on Zebra - Feature Requests - CHDK Forum

Mult-Exposure Bracketing Based on Zebra

  • 18 Replies
  • 5456 Views
Mult-Exposure Bracketing Based on Zebra
« on: 31 / October / 2010, 00:04:16 »
Advertisements

Is it possible? For me this makes a lot of sense for use with programs like PhotoAcute -  especially when taking lots of shots outdoors throughout the day in highly variable lighting conditions.

However I have no idea of this is possible: Select the exposure range based on zebra-ed areas with choice of number of shots/gradations between high and low.

I looked at the Lua and uBasic scripting languages and would give them a go if I had any idea where and how to start. My background is in FORTRAN, Basic and some machine language (on ancient processors).

A search of this forum yielded some similar ideas (zebra for focus and others) but it doesn't look like anyone posted about this before. DR is the big issue with small sensor cameras and any little advantage we can gain that eases the job of acquiring multiple exposures would be worth the effort to create - especially for outdoor photography. I'm willing to try.

cantain

ps - almost forgot - it would also be nice to "lock" an exposure/focus point ( half-pressed shutter ) without holding the shutter button down - and then adjust the zebra pattern via EV, Tv, Av, etc. That would be too good! Maybe someone already achieved something like this.

happy hallloween!  :blink:  :)

*

Offline reyalp

  • ******
  • 11902
Re: Mult-Exposure Bracketing Based on Zebra
« Reply #1 on: 31 / October / 2010, 00:22:23 »
One of the ideas I've had along these lines is to automatically capture a RAW/DNG if the histogram shows lots of dynamic range in the scene.

You could do this in script with shot_histogram I think, but it means you have to use script for shooting all the time.
Quote
ps - almost forgot - it would also be nice to "lock" an exposure/focus point ( half-pressed shutter ) without holding the shutter button down - and then adjust the zebra pattern via EV, Tv, Av, etc. That would be too good! Maybe someone already achieved something like this.
Canons firmware already has AE and AF lock on many models, check your manual.
Don't forget what the H stands for.

Re: Mult-Exposure Bracketing Based on Zebra
« Reply #2 on: 01 / November / 2010, 00:53:15 »
One of the ideas I've had along these lines is to automatically capture a RAW/DNG if the histogram shows lots of dynamic range in the scene.
Quote

Thanks to CHDK I shoot RAW at all times. Basically there is never a time when I don't want DNGs piling up, especially with the extra bits of headroom. However your idea doesn't address the blowout issue and its awkward solution via bracketing and stacking programs.

You could do this in script with shot_histogram I think, but it means you have to use script for shooting all the time.
Quote

Are you referring to your idea above or my feature request for auto bracketing using the zebra regions as hi/lo brackets? After reviewing related ideas on this forum and what google brought up, I am thinking my idea would work well for the niche user who wants to do more than just experiment with stacking.

About running a script at all times (when zebra bracketing is desired), would that cause any serious slowing of the camera? I don't think running a script (when desired) is an issue if it serves its purpose and does not seriously degrade camera performance.

I take mostly static landscape shots and macros. In the case of bright sunny landscapes I'm sure you're more than aware of being forced to choose between highlights or shadows - with the occasional alignment of stars resulting in an all-around ideal shot. Since these are 1 out of 1000 the other 999 could really benefit by accurate and easily accessible bracketing based on the actual scene in question - and the ideal way would be to reference the zebra areas for the brackets.

Quote
ps - almost forgot - it would also be nice to "lock" an exposure/focus point ( half-pressed shutter ) without holding the shutter button down - and then adjust the zebra pattern via EV, Tv, Av, etc. That would be too good! Maybe someone already achieved something like this.
Quote
Canons firmware already has AE and AF lock on many models, check your manual.
Quote

I'm using an S3 and was amazed at how many features like AE and AF lock, contrast, sharpness and saturation control in "custom colors" so that issue is a non-issue. Having zebra-based bracketing along with these features would turn the S3 into an excellent little beast for everything but the most extreme landscapes.

For me (and others I assume), the ideal implementation would be one which operates with a full shutter press (so its always on the ready) and allows for as many sub-bracketed photos withing the overall zebra bracketed range for a particular AE or ME scene.


*

Offline reyalp

  • ******
  • 11902
Re: Mult-Exposure Bracketing Based on Zebra
« Reply #3 on: 01 / November / 2010, 01:52:41 »
Are you referring to your idea above or my feature request for auto bracketing using the zebra regions as hi/lo brackets?
You could bracket based on the output of shot_histogram.
Quote
About running a script at all times (when zebra bracketing is desired), would that cause any serious slowing of the camera? I don't think running a script (when desired) is an issue if it serves its purpose and does not seriously degrade camera performance.
Performance wouldn't be a concern, but control might be less convenient.
Don't forget what the H stands for.


Re: Mult-Exposure Bracketing Based on Zebra
« Reply #4 on: 01 / November / 2010, 02:39:28 »
Are you referring to your idea above or my feature request for auto bracketing using the zebra regions as hi/lo brackets?
You could bracket based on the output of shot_histogram.
Quote

Here is where I'm clueless - almost. I tried a search for shot_histogram here and google but don't quite understand the bigger picture. Is shot _histogram data used for the drawing zebra patterns as well as for the histogram?

If you could give me some references for shot_histogram and/or your own description (for a person who has an elementary understanding of line-by-line programming and little understanding of the workings of CHDK) that would encourage me to attempt to program this script myself. I've been wanting to get back into programming, at least for fun.

About running a script at all times (when zebra bracketing is desired), would that cause any serious slowing of the camera? I don't think running a script (when desired) is an issue if it serves its purpose and does not seriously degrade camera performance.
Performance wouldn't be a concern, but control might be less convenient.

The only script I've used is the bad pixel script. Considering CHDK overall, I didn't find the procedure inconvenient.
Is the multi-bracketing I mentioned possible, so we could select a number of sub-brackets and and specify intervals for these nested bracket shots? If so I'll start reading up on Lua!

*

Offline reyalp

  • ******
  • 11902
Re: Mult-Exposure Bracketing Based on Zebra
« Reply #5 on: 01 / November / 2010, 12:15:18 »
Here is where I'm clueless - almost. I tried a search for shot_histogram here and google but don't quite understand the bigger picture. Is shot _histogram data used for the drawing zebra patterns as well as for the histogram?
shot_histogram allows your script to read a histogram of the previous shot. The numbers in the lowest and highest parts of the histogram will show you how many pixels are under and over exposed. You'd have to do some experimenting to determine what ranges were best for your purpose.
Quote
The only script I've used is the bad pixel script. Considering CHDK overall, I didn't find the procedure inconvenient.
You only have to run badpixel once, it's not the same as using a script to take every shot. Only you can decide whether that is acceptable or not.
Quote
Is the multi-bracketing I mentioned possible, so we could select a number of sub-brackets and and specify intervals for these nested bracket shots? If so I'll start reading up on Lua!
I don't really understand what you mean. You can take any number of exposures from a script, with any exposure parameters you like. You could certainly decide these things based on shot_histogram output.

Writing a script like this will require some programming ability and understanding of CHDK.

btw, if you quote a post, you should put in [/ quote] (without the space) so it doesn't look like your comments are part of the quite.
Don't forget what the H stands for.

Re: Mult-Exposure Bracketing Based on Zebra
« Reply #6 on: 01 / November / 2010, 19:59:15 »
Quote
shot_histogram allows your script to read a histogram of the previous shot. The numbers in the lowest and highest parts of the histogram will show you how many pixels are under and over exposed. You'd have to do some experimenting to determine what ranges were best for your purpose.

Ok. It might be useful for analyzing a photo already in the camera but its totally useless for setting up a shot to be taken. See my new feature request for ability for script to read live view.

Quote
Quote
Quote
The only script I've used is the bad pixel script. Considering CHDK overall, I didn't find the procedure inconvenient.
You only have to run badpixel once, it's not the same as using a script to take every shot. Only you can decide whether that is acceptable or not.

If its the only way we can get this feature I have no problem running a script - especially since its won't slow the camera down. I'd probably leave it running always anyway since I plan to take many bracketed sets once I buy a stacking program. If you have another idea about how to achieve bracketing based on zebra-ed areas without using script please post it here.

Quote
Quote
Quote
Is the multi-bracketing I mentioned possible, so we could select a number of sub-brackets and and specify intervals for these nested bracket shots? If so I'll start reading up on Lua!

I don't really understand what you mean. You can take any number of exposures from a script, with any exposure parameters you like. You could certainly decide these things based on shot_histogram output.



That's what I assumed would be possible but was just checking. However my feature request (and others that are similar) are non-starters without the ability for scripts to read from the live view.

*

Offline reyalp

  • ******
  • 11902
Re: Mult-Exposure Bracketing Based on Zebra
« Reply #7 on: 01 / November / 2010, 22:13:18 »
Quote
shot_histogram allows your script to read a histogram of the previous shot. The numbers in the lowest and highest parts of the histogram will show you how many pixels are under and over exposed. You'd have to do some experimenting to determine what ranges were best for your purpose.

Ok. It might be useful for analyzing a photo already in the camera but its totally useless for setting up a shot to be taken.
I don't see why it can't be used for the feature you want. The first shot will be a normal exposure. Based on the histogram of that shot, the script can decide how much bracketing is required to cover the dynamic range of whole scene. You might end up with one extra exposure. Of course it's not as convenient as having live histogram would be, but it's available now.
Don't forget what the H stands for.


*

Offline hwntw

  • ***
  • 158
Re: Mult-Exposure Bracketing Based on Zebra
« Reply #8 on: 05 / January / 2011, 09:08:11 »
One of the ideas I've had along these lines is to automatically capture a RAW/DNG if the histogram shows lots of dynamic range in the scene.

You could do this in script with shot_histogram I think, but it means you have to use script for shooting all the time.
Quote
ps - almost forgot - it would also be nice to "lock" an exposure/focus point ( half-pressed shutter ) without holding the shutter button down - and then adjust the zebra pattern via EV, Tv, Av, etc. That would be too good! Maybe someone already achieved something like this.
Canons firmware already has AE and AF lock on many models, check your manual.
The problem with this suggestion is that exposure lock on my Ixus 95 is the same button which is used for changing Ev- half shutter/top button. Trying to change exposure turns AE lock off. I think that the original idea for an improved zebra remains a good one. If anyone wants to code something I am happy to test it.
Ixus 300HS S100


Windows 10

*

Offline Lebeau

  • ***
  • 187
Re: Mult-Exposure Bracketing Based on Zebra
« Reply #9 on: 05 / January / 2011, 10:55:45 »
Here is my script for automatic HDR
Code: [Select]
--[[
@title AutoHDR
@param a Black Level
@default a 25
@param b White Level
@default b 230
@param c Percentage of histogram
@default c 1
--]]

proptable=...

if a<0 then
    a=0
elseif a>20 then
    a=20
end
-- define black level
blacklevel=a

if b<220 then
    b=220
elseif b>255 then
    b=255
end
-- define white level
whitelevel=b

if c<1 then
    c=1
elseif c>10 then
    c=10
end
-- percentage of histogram
level=c

-- ---------------------------------------------------------------

function howmanypixelsareunder(upperlimit)
    m=0
    r=0
    r=md_detect_motion(36, 27, 1, 300, 100, 255, 0, m, 0, 1, 1, 1, 1, 0, 1, 301)
    numbers=0
    for i=1, 36 do
        for j=1, 27 do
            r=md_get_cell_diff(i, j)
            if r < upperlimit then
                numbers=numbers+r
            end
        end
    end
    numbers=numbers*100/(36*27)
return numbers
end

function setexposure(exposure)
    set_prop(proptable.EV_CORRECTION_1, exposure*32)
    set_prop(proptable.EV_CORRECTION_2, exposure*32)
    --- half press to set correct exposition
    press("shoot_half")
    repeat
    until get_shooting() == true
return exposure
end

function takeashut(success)
    --- take the zero shot
    press("shoot_full")
    repeat
    until get_shooting() == true
    release("shoot_full")
    repeat
    until get_shooting() == false
    release("shoot_half")
    repeat
    until get_shooting() == false
return success
end

--- opening
x=get_prop(proptable.EV_CORRECTION_1)
y=get_prop(proptable.EV_CORRECTION_2)

-- initiating
-- exposure in 1/32e ... 3 means 1 ev
exposure=setexposure(0)

--- how many pixels are underexposed
underexpose=howmanypixelsareunder(blacklevel)

--- how many pixels are overexposed
overexpose=100-howmanypixelsareunder(whitelevel)

--- take the initial shut
success=takeashut(1)

--- while overexposed and exposure >= -9
while overexpose > level and exposure >= -9 do
    exposure=setexposure(exposure-3)

    --- how many pixels are still overexposed
    overexpose=100-howmanypixelsareunder(whitelevel)

    --- take the under exposure shot
    success=takeashut(1)
end
   
--- reset to zero exposure
exposure=setexposure(0)

--- while underexposed and exposure <= +9
while underexpose > level and exposure <= 9 do
    exposure=setexposure(exposure+3)

    --- how many pixels are still underexposed
    underexpose=howmanypixelsareunder(blacklevel)

    --- take the over exposure shot
    success=takeashut(1)
end

--- reset to zero exposure
exposure=setexposure(0)

--- closing
set_prop(proptable.EV_CORRECTION_1, x)
set_prop(proptable.EV_CORRECTION_2, y)


 

Related Topics