Author Topic: Auto Hand Held Bracketing Script  (Read 4333 times)

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1799
Auto Hand Held Bracketing Script
« on: February 11, 2018, 05:53:21 PM »
This script attempts to create an 'optimized' set of brackets when hand holding.

The script may be downloaded from here: https://gist.github.com/pigeonhill/7efb6b13e34e366d2651ba574125a5fa

The script uses a two pass bracketing scheme and the idea for the script was triggered by reading https://people.csail.mit.edu/hasinoff/pubs/hasinoff-hdrnoise-2010.pdf

The script assumes you have set exposure to capture the highlights, eg using ETTR. You should have advanced bracketing off, so you can use ETTR as part of your capture workflow. The script will switch advanced bracketing on and off.

The first pass takes three brackets using ISO shifting up to the maximum ISO, which is sensibly assumed to be 6400 in the script.

The script will then see if a second pass can be accomplished, ie if the base shutter was above the minimum shutter. If a second pass can be taken the script will take two additional brackets from the minimum shutter speed and the maximum ISO, ie doing time bracketing at a fixed, max ISO.

Thus you will always get either 3 or 5 brackets, straddling 1/30s (or your minimum shutter) to the fastest shutter needed for the highlights, and from the lowest ISO you can use for the base highlight to ISO 6400.

As I explore the HHB script I will write about it on my blog at www.photography.grayheron.net.

As usual I welcome testers and feedback.

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1799
Re: Auto Hand Held Bracketing Script
« Reply #1 on: February 13, 2018, 08:45:09 PM »
I've refined the Auto Hand Held Bracketing script, which you can download from here: https://gist.github.com/pigeonhill/7efb6b13e34e366d2651ba574125a5fa

The script is now focal length aware, ie if you choose auto mode (FF or Crop) it will ensure the ETTR min shutter is adjusted.

In ETTR mode, select in the script's menu, you control things by setting the min shutter yourself, ie in the ETTR menu.

Please read the script's comments for more info.

As before, advanced bracketing should be switched off, so you can use ETTR. The script will switch bracketing on and off.

The script is switched on by doing a 3sec + half shutter press, thus you can hand hold to your eye, undertake an ETTR (use double press to trigger) and then switch on the auto HHB script, all without your eye leaving the camera (unless you are in LV mode and hand holding at a distance from your eye).

Here are a couple of screen captures of a test image I just took in our kitchen. The ETTR (0% highlights) chose 1/15 (auto set by the script from the focal length of the lens), at F/7.1 on my 12mm at ISO 100; as the base exposure for the highlights. The script then bracketed from there to ISO 800 and SO 6400. No additional time brackets were taken as the base shutter was not faster than the slowest shutter.

LR capture (below) shows the three brackets, then the HDR merged image, then the post processed in LR image.

I've also added a jpeg of the final processed image.

Looking forward to hearing how others get on with the script.

BTW I've tested it on my 5D3 so far.






garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1799
Re: Auto Hand Held Bracketing Script
« Reply #2 on: February 17, 2018, 06:17:35 PM »
I've refined the Hand Held Bracketing Script (which can be downloaded from here: https://gist.github.com/pigeonhill/7efb6b13e34e366d2651ba574125a5fa).

The menu has the following options:





And here are four hand held images I took today, using the script, inside Winchester Cathedral.










garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1799
Re: Auto Hand Held Bracketing Script
« Reply #3 on: February 18, 2018, 05:54:32 PM »
I've posted a short tutorial here: http://photography.grayheron.net/2018/02/auto-hand-held-bracketing.html

As well as a few more images.

IDA_ML

  • Hero Member
  • *****
  • Posts: 646
Re: Auto Hand Held Bracketing Script
« Reply #4 on: February 19, 2018, 11:23:29 AM »
Fantastic work, Garry, keep it up!  Perfect for people like me who do not like carrying tripods around.  Pictures are really impressive!

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1799
Re: Auto Hand Held Bracketing Script
« Reply #5 on: February 19, 2018, 06:59:17 PM »
Have tidied things up and hopefully made the ISO bracketing logic more robust.

Here is the latest script: https://gist.github.com/pigeonhill/7efb6b13e34e366d2651ba574125a5fa

Would really welcome other users trying it out ;-)

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 5919
Re: Auto Hand Held Bracketing Script
« Reply #6 on: February 19, 2018, 07:24:28 PM »
This looks great. Will try it as soon as I can. Thanks for contributing.

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1799
Re: Auto Hand Held Bracketing Script
« Reply #7 on: February 19, 2018, 07:50:18 PM »
@Danne

Looking forward to hearing what you and others think. My weekend experience, in Winchester Cathedral, went well, and as I say on my blog, I can recommend using it with ETTR on, initiated with a double press, and with the audio feedback on in the script and a 2 sec delay in the script,, so you know the script is ready and you have a couple of seconds to compose yourself. 

It was a pleasure to use, ie the ETTR and HHB workflow went well.

As an aside, I was also impressed in post to see how well LR handled the hand held pano challange, where as a more specialised piece of pano software struggled. See my pano posted earlier.

Cheers

Garry

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1799
Re: Auto Hand Held Bracketing Script
« Reply #8 on: February 19, 2018, 11:10:23 PM »
Damn!!!

Just spotted a silly coding error: now corrected  :)

https://gist.github.com/pigeonhill/7efb6b13e34e366d2651ba574125a5fa

ToniX

  • Freshman
  • **
  • Posts: 76
Re: Auto Hand Held Bracketing Script
« Reply #9 on: February 20, 2018, 01:02:32 AM »
Hi @garry23,

...in order to run the script, I just need to save it as .LUA (notepad or specific editor?) and then drop it into the ML's script folder?

Does it will work on 600D?

(forgive my ignorance,  I am only recently aware of the existence of LUAs ...)

Thanks

600D - EFs18-55 ISII

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1799
Re: Auto Hand Held Bracketing Script
« Reply #10 on: February 20, 2018, 07:30:59 AM »
@ToniX

I recommend you use the Lua fix ML download from the experimental branch, it is the most up to date, and the 600D is there.

Make sure you switch on the Lua and ETTR modules, as well as other modules that you need, eg Dual-ISO.

As for setting, make sure you set the ETTR up, eg double press, highlight ignore should be low, say 0.1%, dual should be off and the s/n option 0.

Let me know how you get on.

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1799
Re: Auto Hand Held Bracketing Script
« Reply #11 on: February 20, 2018, 07:40:01 AM »
@ToniX

...also when you down load the script it will have the Lua file extension. Place the file in the ML scripts folder.

You will see loads of other scripts there as well. I personally remove these to another folder so they don't run.

When you then switch the camera on you will need to enable the modules, once only. Then go to the scripts tab and enable my script, i.e. Auto run on.

BTW I recommend you also try the focus bar script as well.

Cheers

Garry

ToniX

  • Freshman
  • **
  • Posts: 76
Re: Auto Hand Held Bracketing Script
« Reply #12 on: February 20, 2018, 05:42:52 PM »
Thanks for the instructions and for the various suggestions (it seems to me everything is clear!). :)

I will test in the next days, I will report my impressions.

Thanks for the availability and congratulations for your photos on 500px, I'm following you now.
600D - EFs18-55 ISII

IDA_ML

  • Hero Member
  • *****
  • Posts: 646
Re: Auto Hand Held Bracketing Script
« Reply #13 on: February 21, 2018, 11:10:13 AM »
Garry,

I have a few questions on your script:

1) Keeping in mind that some of the shots are taken at high ISO - 6400, where does the noise go?  Averaging???  Your examples look amazingly clean.

2) What about misalignment between the different shots?  If the bracket is taken handheld, there will deffinitely be some misalignment beween the frames.  Does the post process take care of it?

3) Does Photomatix provide a good result with merging the single frames?  Have you tried that?

Thanks.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12290
  • Emergencies only
Re: Auto Hand Held Bracketing Script
« Reply #14 on: February 21, 2018, 03:15:53 PM »
1) Keeping in mind that some of the shots are taken at high ISO - 6400, where does the noise go?  Averaging???  Your examples look amazingly clean.

Misconceptions 101 - higher ISOs have less noise, all other exposure variables being equal (including the brightness of the output image). This was discussed many times, and Garry himself linked to a paper on this subject a few posts ago.

In particular, for 5D3, log2(34.9 / 2.5) = almost 4 stops of better shadow performance with ISO 6400, compared to ISO 100. Price to pay for that: 6 stops of clipped highlights.

When bracketing, you take the highlights from other images, possibly captured at lower ISOs and/or faster shutter speed. Problem solved. The same happens with Dual ISO.

P.S. compare these plots with the ones from Hasinoff's paper (in particular, Fig. 2b) :)

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1799
Re: Auto Hand Held Bracketing Script
« Reply #15 on: February 21, 2018, 10:17:27 PM »
@IDA_ML

As @a1ex says, there are many misconceptions out there regarding 'noise'. Also, total noise is made up of many components, eg photon shot noise and 'electronic-camera-related noise' etc.

Anyway, as @a1ex says, higher ISOs have less read-noise, as seen in this graph for a 5D3 taken from photonstophotos:




free photo hosting websites


Note log2 scaling, and that once the ISO enters the ISO invariant zone, around 1600-3200, the images become (relatively) ISO noiseless, ie no more noise is added and the electronic noise is at its lowest, eg a few electrons per photo site.

Of course, noise, on its own is not a good metric for IQ. You need signal; and at high ISO signal is low.

As for alignment, unless you are radically moving the camera, the auto align algorithms seem to do well. At least from my experience using HDR Merge in LR: BTW I don't use Photomatix.

Bottom line: This version of the script works reasonably well, but I'm still experimenting with strategies. For example, I just tried a version that took n max ISO images on top of the ISO bracketed ones. My thinking was to exploit the sqrt(n) noise reduction. But the issue is post processing all the differently processed sub-brackets, eg can't process all of them at one go. I need to do some more thinking if I'm to get the last ounce out of the script ;-)

BTW here is another image I processed from my Winchester trip, that I think shows the power of the technique - once again hand held:





POSTSCRIPT: Just tried Photomatix (I have it, but gave up using it in favour of LR-HDR Merge), and in fusion-natural mode it tooks pretty good.

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1799
Re: Auto Hand Held Bracketing Script
« Reply #16 on: February 21, 2018, 11:23:21 PM »
BTW @IDA_ML here is a Photomatix (6) processed image from my Winchester hand held shoot:




Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 5919
Re: Auto Hand Held Bracketing Script
« Reply #17 on: February 22, 2018, 06:26:35 AM »
Hi garry23. Could you share the six images from your winchester capture? I am trying out three different ways to produce aligned and merged tifs. Will post the results here if you don't mind.

IDA_ML

  • Hero Member
  • *****
  • Posts: 646
Re: Auto Hand Held Bracketing Script
« Reply #18 on: February 22, 2018, 03:53:35 PM »
Thank you, А1еx for these important sources and thank you, Garry23 for sharing your quite impressive results.  Thanks to you, guys, I will have some very interesting material to read and a new module to experiment with for the weekend.

I do have one more question to Garry23 though.  I have been using Dual ISO quite a lot lately and really love it because it gives me 2-3 stops of increased dynamic range with just one single FRSP shot.  With the latest trigger options, it works extremely well with handheld stabilized lenses in low-light conditions generating losslessly compressed FRSPs and also provides very natural colors.  Reduced resolution in the highlights and shadows has never been an issue for me or at least, I never noticed a visually noticeable problem with that.  Workflow is also greatly simplified.  I just use the cr2hdr utility to convert the Dual ISO images to DNG files and then I process the latter in Photoshop or Lightroom as any RAW file. 

So, my question is:  Have you compared your bracketing method with the Dual ISO method and if yes, which one of both methods provides better image quality, less artifacts and more naturally looking results?  Your experience and opinion on that should be greatly appreciated.

ToniX

  • Freshman
  • **
  • Posts: 76
Re: Auto Hand Held Bracketing Script
« Reply #19 on: February 22, 2018, 06:24:22 PM »
@IDA_ML   Braketing is more suitable for static subjects, while Dual ISO allow more DR in scenes with moving subjects. I would say that these are complimentary techniques for HDR shooters.
600D - EFs18-55 ISII

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1799
Re: Auto Hand Held Bracketing Script
« Reply #20 on: February 22, 2018, 06:26:20 PM »
@IDA_ML

Dual-ISO and my (Auto) Hand Held Bracketing script are complementary, and I use both.

I will consider Dual first, because it works with a single image: but, relative to the HHB script it doesn't cover as high a DR.

I wrote the HHB mainly for one use case: when I'm in a high DR environment, like a church etc, but where tripods are either not allowed or difficult to use.

Also, unlike dual-ISO, the HHB script is sensitive to movement in the scene, eg people moving.

You may wish to try the latest version of the script: https://gist.github.com/pigeonhill/7efb6b13e34e366d2651ba574125a5fa

I've rethought the bracketing strategy to try and maximise the DR, ie get the most photons, so my two passes approach goes like this:
* Pass one will attempt a time bracket from the highlights starting point
* Pass two will carry out an ISO bracket set from the min hand holding shutter point

I look forward to others trying out the latest bracketing strategy.

Cheers

Garry

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1799
Re: Auto Hand Held Bracketing Script
« Reply #21 on: February 22, 2018, 08:30:39 PM »
@Danne

PM'd you  ;)

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 5919
Re: Auto Hand Held Bracketing Script
« Reply #22 on: February 22, 2018, 10:08:54 PM »
Great images to bracket. Thanks for sharing. I published a lot of code into Switch lately around HDR automation. Will group images checking time gap. Tried by detecting motion through hugin align_image but wasn´t reliable so back to time gap procedures. Anyhow I got three HDR workflows which I test and will write some more about those in a forum post later. Here are my examples from your cr2 files.

Code:
https://bitbucket.org/Dannephoto/switch/src/dd1ec9f982b2da7865108610b0b3366b01109573/Switch.app/Contents/bash/HDR_CR2.command?at=default&fileviewer=file-view-default


hugin align/enfuse
file: https://bitbucket.org/Dannephoto/magic-lantern/downloads/Enfuse__GJG5720-preview3-_GJG5724-preview3.tif


hugin/align to FFmpeg(tblend filter)
file: https://bitbucket.org/Dannephoto/magic-lantern/downloads/FFmpeg__GJG5720-preview3-_GJG5724-preview3.tif



HDRmerge
http://jcelaya.github.io/hdrmerge/
file: https://bitbucket.org/Dannephoto/magic-lantern/downloads/HDRmerge__GJG5720-5724.dng
Example dng(did not work good at all):



garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1799
Re: Auto Hand Held Bracketing Script
« Reply #23 on: February 22, 2018, 10:38:45 PM »
@Danne

I've experimented with Aurora HDR, Photomatix, LR/Enfuse and LR-HDR-Merge. I think all are four worth using, with LR-HDR-Merge the 'simplest'.

It is instructive to compare my image (https://ibb.co/b2MVSc) of the same brackets with yours, i.e. processed in LR Merge.

I have only tried the latest version of the script at home. As soon as I can get in a more realistic environment, eg a church etc, I won't know if the latest bracketing strategy is better the my original. My gut feeling is that it should.

Cheers

Garry

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1799
Re: Auto Hand Held Bracketing Script
« Reply #24 on: February 23, 2018, 09:20:51 AM »
Although I thought it was making my life easier using the ML Advanced Bracketing, in fact it was complicating managing the ISO and Time brackets between the limits, ie highlight starting point and min hand holding shutter.

I have therefore dropped using the advanced bracketing in the script and switched to explicitly controlling the required brackets.

The code is simpler and I'm not limited to the delta Ev between brackets.

Here is the updated code: https://gist.github.com/pigeonhill/7efb6b13e34e366d2651ba574125a5fa