Author Topic: Auto ETTR based on RAW histogram (ettr.mo)  (Read 161182 times)

l_d_allan

  • Senior
  • ****
  • Posts: 258
Auto ETTR based on RAW histogram (ettr.mo)
« on: April 20, 2013, 02:11:30 AM »
https://bitbucket.org/hudson/magic-lantern/src/tip/modules/ettr/README.rst?

Quote from: Original Post
Alright, now you have true RAW histogram and zebras. 5D2 only.

Very cool. Great work.

Would it be possible to have "Automatic ETTR" capability? It would perhaps select the maximum exposure that only blew out one of the RGBG channels. That would let ACR PV2012 do its magic at a near optimal level.

The photographer would obviously be responsible for not including a specular highlight, such as the sun or chrome, etc.

For my "use case" on panoramas, I'd pick a bright frame that excluded specular highlights, determine the suggested, automatic ETTR exposure from ML, and then set the camera on Manual with that exposure.

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3657
  • Blunt and to the point
Re: Auto ETTR based on RAW histogram?
« Reply #1 on: April 20, 2013, 03:11:55 AM »
I don't see how this would be much faster then doing it in live view.  And what would ML adjust to increase exposure, shutter, aperture or ISO?  You might be happy with ISO, others with shutter etc.

Marsu42

  • Contributor
  • Hero Member
  • *****
  • Posts: 1557
  • 66d + flashes
Re: Auto ETTR based on RAW histogram?
« Reply #2 on: April 21, 2013, 01:59:20 PM »
And what would ML adjust to increase exposure, shutter, aperture or ISO?  You might be happy with ISO, others with shutter etc.

Imho longer shutter and maybe lower iso for handheld would be good since it doesn't change the picture/dof, the apex computation of these things is already there, that doesn't seem to be a problem to me.

But I thing auto-ettr is an absolute stellar idea since it is a bit of a fix for the major shortcoming of Canon's current crop sensor: low shadow resolution and noise. I often do bracketing not because of a high dr scene, but I want to ettr in raw but don't quite know how much is safe (after highlight recovery in acr), so this feature would save time and shutter cycles.

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 2228
Re: Auto ETTR based on RAW histogram?
« Reply #3 on: April 21, 2013, 04:27:40 PM »
I have written this to hopefully help the broader ML community better understand some of the ‘feature requests’, in this case ETTR.

Obviously it is written from an ‘IMO stance’ as ETTR and other strategies to maximize dynamic range, or captured image data fidelity, are not universally agreed upon.

First, to maximize the captured data’s fidelity for post processing I believe we need to try and accomplish several things with our exposures (other than ensure they are in focus etc): minimize noise, maximize S/N and capture the most tonal information on each sensor element (RGBG). However, trying to accomplish all these at once, for a real world scene, is near impossible.

For example, to minimize noise we should only shoot with a camera cooled to its lowest operating temperature, eg to minimize dark current noise. The longer we shoot and if we shoot on hot days this noise contribution will increase, just like entropy.

To maximize S/N we should seek to capture the maximum number of photons, and no more, ie achieve a Full Well situation. However, although we may be able to do this for a real scene, it will only be achieved in the few sensor elements in the brightest part of the scene, it a very small % of the overall statistics of the captured image. For instance the subject/focus of the scene may be in the mid tones or lower, ie not a specular highlight that is creating the Full Well situation.

I believe we all now know that DSLR cameras do not capture and process light like our eyes or film. The process is linear and thus this is why there is apparent merit in ETTR and bracketing strategies. That is trying to get the maximum tonal graduation into the capture, without ‘blowing out’ important data.

So far so good.

I think bracketing is not ‘contentious’ as we usually are on a tripod and at the base/lowest ISO, ie where we can guarantee that some of the sensor elements capturing the scene information we deem important will be at their Full Well level, albeit only a few %, unless we ‘over bracket’.

I think the issue comes when we introduce the ISO factor, ie when doing a handheld bracketing set or seeking a handheld ETTR single exposure. In both cases we may need to increase the ISO to achieve a good shutter speed, eg the slowest bracket greater than 1/FL, say OR greater than 1/50, say.

I for one take a lot of handheld 3-brackets on my 5DMkIII and have confidence that increasing the ISO will not create too many issues in post processing. However, from my reading on sensors etc, I will not increase the ISO above about 1600-3200, as this will transition me from the region where the camera noise sources dominate to where the sensor limitation dominate, ie I’m just not capturing enough photons at high ISO. This transition will vary for each camera, but the bottom line is, that if we follow an ETTR strategy, there is an upper limit (ISO) we should all be aware of.

In conclusion, I believe ML is on the right track by giving the user choices to maximize DR and S/N wrt the scene, ie extended bracketing (although with my 5DMkIII this is less importance compared to my 50D) and a RAW LV histogram (a transformational feature).

Finally, IMHO, using all the ML features without understanding the camera-system’s limitations could bring disappointment.

l_d_allan

  • Senior
  • ****
  • Posts: 258
Re: Auto ETTR based on RAW histogram?
« Reply #4 on: April 25, 2013, 03:48:51 PM »
I don't see how this would be much faster then doing it in live view.

To me, the issue is that that histogram from 0-255 ends up being fairly low resolution when you really want to see what is going on from the equivalent of 245 to 255 illumination per channel.

A real nice-to-have capability oriented to ETTR would be a RAW-based histogram from 245-255 for just the 10x region where you were zoomed into. That would enable avoiding the specular highlights that are ok to be blown out.

Quote
And what would ML adjust to increase exposure, shutter, aperture or ISO?  You might be happy with ISO, others with shutter etc.

I would think I'd invariably be interested in shutter speed. At some point, the exposure time gets too long in dark scenes, and then you can use reciprocity to get an equivalent exposure.  For example, ML might calculate ISO 100, f8, and end up with 4 minutes. I might be willing to use ISO 400 and f5.6 to use 30 seconds (if I did the math correctly).

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 2228
Re: Auto ETTR based on RAW histogram?
« Reply #5 on: April 26, 2013, 12:32:36 AM »
May I simply endorse the above and ask if it would be possible to factor in a user variable that allows the user to select the entire histogram or a fraction of it, from the 100% highlight end. It could be in stops or fractions of the full histogram.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Auto ETTR based on RAW histogram?
« Reply #6 on: April 26, 2013, 07:29:53 AM »
You can just count the stops till overexposure on the histogram, or read the spotmeter, and then count the clicks on the shutter speed dial. So if your test picture is underexposed a bit, you can tell at a glance how many stops you have to adjust.

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 2228
Re: Auto ETTR based on RAW histogram?
« Reply #7 on: April 26, 2013, 03:29:55 PM »
Alex

I suggested the above as I thought you had worked outa way to display a RAW histogram in LV, rather than 'just' in review mode.

In other words if a RAW histogram can be displayed in LV I would like to suggest a user option to display, say, the right hand highlight stop as a zoomed in histogram would be very useful


a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Auto ETTR based on RAW histogram?
« Reply #8 on: April 29, 2013, 02:00:41 PM »
Here's a semi-automatic implementation: on the histogram, ML now shows by how many stops you can push the exposure to the right without clipping (or, with clipping the green channel only, if you prefer).

So, take a test picture, adjust the exposure by that number, and get the optimal SNR.

https://bitbucket.org/hudson/magic-lantern/commits/37bec2dc9ea3

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: Auto ETTR based on RAW histogram?
« Reply #9 on: April 29, 2013, 04:31:24 PM »
BTW: 5d2 method working for 600D but the alignment/pitch is off. I'm only getting red channel and zebra image is distorted. The state transition is the same.... I wish I knew how to verify that I have the correct reg because its not working on M and the transition is the same... maybe just a sync issue.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Auto ETTR based on RAW histogram?
« Reply #10 on: May 21, 2013, 10:12:16 PM »
Got it working.

This will probably convince me to shoot in auto ETTR, because it exposes exactly the way I want.

Going to try it this weekend at a small local event.

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Re: Auto ETTR based on RAW histogram?
« Reply #11 on: May 21, 2013, 10:52:59 PM »
Got it working.

This will probably convince me to shoot in auto ETTR, because it exposes exactly the way I want.

Going to try it this weekend at a small local event.

I just tried it.   Seems that it needs two or three pictures before it get its right. 
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: [DONE] Auto ETTR based on RAW histogram?
« Reply #12 on: May 21, 2013, 10:54:51 PM »
If your picture is overexposed, it has no way to know by how much. So, start with an underexposed one and will get it right in one step.

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Re: [DONE] Auto ETTR based on RAW histogram?
« Reply #13 on: May 21, 2013, 11:01:58 PM »
Yea, that is what I though it was happening.  At first I could not get it to work but then I noticed small changed in exposure from one pic to the next!  I will take some pictures and see how good I can recover shadows and not over expose.

Also noticed that on the last build 5D3 I am getting bad frames on all RAW modes when I press zoom.  Every time, every 40 frames or so I get a few bad ones. 
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Re: [DONE] Auto ETTR based on RAW histogram?
« Reply #14 on: May 21, 2013, 11:06:28 PM »
If your picture is overexposed, it has no way to know by how much. So, start with an underexposed one and will get it right in one step.
In big changes of light it take three steps.  When I go from dark ground to something with sky it takes three shots.
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: [DONE] Auto ETTR based on RAW histogram?
« Reply #15 on: May 21, 2013, 11:07:55 PM »
Tip: in the Histogram menu, set the EV indicator to ETTR hint. It will show you by how much it will change the exposure.

And even if you turn off Auto ETTR, you will still get the hint, so you can do the adjustment manually if you want.

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Re: [DONE] Auto ETTR based on RAW histogram?
« Reply #16 on: May 21, 2013, 11:17:33 PM »
Thats great.  Maybe the cam should take consecutive pics until the hint is near zero and then stops.  Although it does not always go to zero but say maybe +- 0.5 is good enough. 

I tried just pressing the button burst, but no adjustment was made.  Can it calculate fast enough to just burst three or four pics?
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Re: [DONE] Auto ETTR based on RAW histogram?
« Reply #17 on: May 21, 2013, 11:25:46 PM »
Its great.  I tested the highlights and could recover them pretty well.  There was no apparent overblown areas in the highlights.

This is good for Canon, double the shutter counter=more spare parts.  :D

Congratulations!!!!
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: [DONE] Auto ETTR based on RAW histogram?
« Reply #18 on: May 21, 2013, 11:27:51 PM »
It doesn't work in burst because you can't change settings in the middle of shooting. So... single pics only.

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: [DONE] Auto ETTR based on RAW histogram?
« Reply #19 on: May 21, 2013, 11:52:13 PM »
Its really good. Much better than P mode. Has to take a pic first I guess unless you open LV?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: [DONE] Auto ETTR based on RAW histogram?
« Reply #20 on: May 21, 2013, 11:57:39 PM »
I didn't enable it for LV yet, but should work. Maybe hook it on histogram update?

1%

  • Developer
  • Hero Member
  • *****
  • Posts: 5936
  • 600D/6D/50D/EOSM/7D
Re: [DONE] Auto ETTR based on RAW histogram?
« Reply #21 on: May 22, 2013, 12:00:10 AM »
Would go together.

clint

  • New to the forum
  • *
  • Posts: 18
Re: [DONE] Auto ETTR based on RAW histogram?
« Reply #22 on: May 22, 2013, 08:03:46 AM »
IS this working on 60D yet?..... I know you guys have been busy giving the camera industry a bit of a shock..... anyway, I tried the RAW histogram with no success, perhaps I missed something obvious.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: [DONE] Auto ETTR based on RAW histogram?
« Reply #23 on: May 22, 2013, 08:25:12 AM »
Nope, only 5D2, 5D3 and 6D for now. One has to port the photo mode raw support. See my porting guide here: http://www.magiclantern.fm/forum/index.php?topic=5240.msg32128#msg32128

Just got it working in LiveView. Now THAT is really usable (it's effectively reading my mind). This is how Canon should have implemented the metering in the first place.

vertigopix

  • Senior
  • ****
  • Posts: 281
  • EOS 6D - EOS M
Re: [DONE] Auto ETTR based on RAW histogram?
« Reply #24 on: May 22, 2013, 08:32:01 AM »
Hope that somebody will port it...
I haven't the skill to do this  :-[ but It's looking very interesting !