Author Topic: Full-screen histogram WIP  (Read 457 times)

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10439
  • 5D Mark Free
Full-screen histogram WIP
« on: October 30, 2017, 10:26:45 PM »
Something like this?








Topic split from here.

Lars Steenhoff

  • Senior
  • ****
  • Posts: 296
Re: Full-screen histogram WIP
« Reply #1 on: October 30, 2017, 10:58:38 PM »
Looks nice! 
I would think if you make it bigger why not use the whole horizontal space. then you know left of the screen is under and right of the screen is over, as long as we are in the middle we are good.
What I mean by this is why the histogram is aligned on the right side if the screen instead of centred.

Also the underexposed grey fill looks less distracting of its on the left side of the screen instead of in the middle right?


a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10439
  • 5D Mark Free
Re: Full-screen histogram WIP
« Reply #2 on: October 30, 2017, 11:44:53 PM »
To keep things simple (integer multipliers), I'd have to resize the small histogram from 128px to either 120 (720/6) or 144 (720/5) or 180 (720/4). No big deal - with the first choice, the histograms look like this:



A bit cluttered for my taste after enabling the zebras, but I'm not sure what to change. The exposure indication is harder to find (low contrast); it's obvious in the small version (being white on black also helps). Maybe it should be moved at the bottom and displayed with black background in the large version as well.

edit: updated second screenshot to show both versions.

edit: the top bar somehow vanished, but to me it looks cleaner without it; what about making the EV grid lines smaller as well?


Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3444
  • Blunt and to the point
Re: Full-screen histogram WIP
« Reply #3 on: October 31, 2017, 05:10:34 AM »
That last example looks schmick.

garry23

  • Hero Member
  • *****
  • Posts: 1311
Re: Full-screen histogram WIP
« Reply #4 on: October 31, 2017, 08:30:15 AM »
Looking forward to this feature being in the experimental builds, ie to try out.

A thought I had, as a stills photographer, is: Once composition is fixed, then looking at the scene becomes secondary, hence can we make use of toggling through INFO to provide a view of the large histogram on a white background?

Trying to read the histogram over a scene is not ideal.

In my focus bar script I try and do this, but I'm afraid, using 'just' Lua, I do get conflicts in writing to the screen. I've tried tracking GUI states, with camera.state, but not very well.

Just a thought.

Cheers

Garry

heyjoe

  • Freshman
  • **
  • Posts: 54
Re: Full-screen histogram WIP
« Reply #5 on: October 31, 2017, 09:48:50 AM »
Something like this?
Yes! :)
I am really happy to see how things are improving. Great work. I also like the DR indication.

Quote
A bit cluttered for my taste after enabling the zebras, but I'm not sure what to change.
Perhaps add options in menu, so the user can choose what elements to have displayed to their own taste. FWIW colored zebras don't work really well while shooting. Example: shoot something green (leaves) and see green zebra on top of it is very difficult to see. Pretty much the same happens with other channels, so maybe another form of zebra display could be good to, e.g. inverted colors: magenta for G, green for R, yellow for B. Or maybe blinking.

Quote
edit: the top bar somehow vanished, but to me it looks cleaner without it; what about making the EV grid lines smaller as well?
Yes, looks better.

Can you also make an option to display only the top and/or bottom 1EV of the histogram but zoomed at full screen? While shooting we don't actually need full statistical analysis of the image (full histogram). What we need is to check exposure at the extreme highlights and shadows.

Do you think it would be possible (worth it) to have (an option) for separate display of the two G channels as histograms? Sometimes they are not the same and clip differently so I've been asking myself what the current G channel histogram actually displays.

heyjoe

  • Freshman
  • **
  • Posts: 54
Re: Full-screen histogram WIP
« Reply #6 on: October 31, 2017, 12:32:22 PM »
BTW thinking further: for visual evaluation of histogram clipping in highlights it may be good to have (an option for) linear horizontal scale (like RawDigger) because with logarithmic it may be difficult to evaluate a hard peak vs smooth (non clipped) on the LCD. Example to illustrate what I mean:

Log horizontal and vertical (like ML currently) shows fairly smooth, may be mistaken for non-clipped:



But with linear horizontal see how well the clipping of green shows:



And if that is combined with a display of only the top 1EV I think there is simply no way to make a mistake (vertical grid lines spaced at 1/3EV may be helpful here in order to know how much to change exposure controls):



For evaluation of shadows it may be necessary to display log/log histogram of several EV. This is image is not a good example as it doesn't have much shadows but here is another example of an image which as both highlights and shadows clipping:




So I suppose ideally on the LCD we would need only the last 2 graphics combined in one, e.g. sth like this (rough ugly sketch, text is just for descriptive purpose):



Perhaps the shadows can be smaller, so that there is more room for highlights histogram, for example 25% width for shadows 75% for highlights or something like that.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10439
  • 5D Mark Free
Re: Full-screen histogram WIP
« Reply #7 on: October 31, 2017, 12:59:41 PM »
May I have the second image for tests?

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 3044
  • 5D3 / M1 / 7D / 70D / SL1
Re: Full-screen histogram WIP
« Reply #8 on: October 31, 2017, 05:47:48 PM »
That last example looks schmick.

+1 and very well said!
5D3.113 • 5D3.123 • EOSM.203 • 7D.203 • 70D.112 • 100D.101

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3444
  • Blunt and to the point
Re: Full-screen histogram WIP
« Reply #9 on: October 31, 2017, 08:53:17 PM »
Log horizontal and vertical (like ML currently) shows fairly smooth, may be mistaken for non-clipped:

That's not exactly an accurate example as the display shows 17 stops.  The point still stands regarding the advantage of increased resolution in the highlights.

What is the usefulness of the shadow area being presented in the manner that rawdigger does?
Personally I prefer the grey marking that ML currently displays.  I don't need to see the lack of bits being represented the way that rawdigger shows, only that there is simply not enough bits there, and that there is data being contained within.

I would like to see the current histogram shadow area being user adjustable along the lines of the zebra underexposure option.  So as a user I can decide, I don't want any data contained within the bottom three stops, and the grey overlay on the histogram will represent these bottom three stops, and I can then move the data in the histogram as needed with exposure.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10439
  • 5D Mark Free
Re: Full-screen histogram WIP
« Reply #10 on: October 31, 2017, 10:47:46 PM »
The linear zoom on the Y axis in the last stop makes sense - it's easier to judge the clipping status in tricky cases.

However, linear scaling on the X axis does not - at least to me. Why? With logarihtmic scaling on X:
- you can always read the offset in EV
- when exposure changes, the entire histogram translates horizontally.

Good luck doing that with a linear-X histogram ;)

BTW, there is already a linear Y scaling option in ML histogram menu. It's off by default because whenever there's a large peak (strong highlight, large flat area, whatever), it will make all the other things look tiny. Try evaluating the exposure from it on the examples below.

While we are at linear scaling on Y, why not consider another "view" - the CDF (integral of histogram) ? In our case, it shows everything a linear histogram does, it requires no scaling (range is always 0 - 100%) and reveals a few other things that are not easy to read from the histogram:

- where the median value is on each channel (just look at the middle point)
- what percentage of shadows are under the noise floor (easy - vertical scale is linear)

The above points are exactly where AutoETTR evaluates the exposure (median, shadow percentiles).

The CDF doesn't do a very good job showing the overexposure (it's not obvious if only a small percentage is clipped), but a zoomed view on e.g. the last two stops (EV on X, linear on Y) shows exactly that.

The CDF is also a LOT smoother out of the box :)

Examples (left: log-Y histogram, middle: linear-Y histogram, right: linear-Y CDF).
All of them are log-X. The zoomed view shows linear-Y histogram for the last two stops:













Note: in all the above examples, the histogram was heavily smoothed, while the CDF is totally raw.



Wait, what? Smoothing?

RawDigger displays thin bars. ML spreads them to nearby bins, to get a continuous graph (though it's still jagged). To draw the lines nicely, I've applied some additional smoothing in shadows, and also wherever the number of data points was very small. You may want to know how much I'm smoothing, so here are some examples.

Top: log histogram. Bottom: CDF.
Left: raw (no smoothing, no spreading). Middle: shadow spreading only. Right: spreading + smoothing.
Test image: ISO 3200, 2-minute exposure (AutoETTR was a bit overzealous when picking this ISO).




In the CDF images, there's barely any difference! They are already smooth out of the box!

On the other hand, the histogram requires aggressive smoothing to look acceptable.

Let's try an extreme example - one where the raw CDF looks bad:




CDF already looks very good after spreading - there's no need for additional trickery.

Histogram:
- left side resembles RawDigger display (this one is totally raw)
- after spreading, there's still one gap left (that gap is actually in the raw data, so it's showing the truth)
- after smoothing, I still don't like the result (too many waves...)



P.S. It's refreshing to be able to program all this without one single shutter actuation :)

(everything was done in QEMU, with existing CR2 images as reference data)

heyjoe

  • Freshman
  • **
  • Posts: 54
Re: Full-screen histogram WIP
« Reply #11 on: November 01, 2017, 12:25:57 AM »
May I have the second image for tests?
Unfortunately I can't send the raw file for which this histogram is shown but I can try to shoot another one with slight clipping of highlights and shadows if that is what you need for testing. Please let me know. Or it may be faster to use one of the studio samples from dpreview or imaging-resource.comThis one seems to have slight clipping of shadows and highlights.

That's not exactly an accurate example as the display shows 17 stops.
Yes, because as the screenshot shows it is using Auto setting for EV scale on X-axis. With 14bit raw files we obviously can't have values above 2^14.

Quote
What is the usefulness of the shadow area being presented in the manner that rawdigger does?
Evaluation of shadow clipping based on the actual raw data. It is not necessary to have it identical (jagged). I just mean to have a "zoom" of the shadows too.

Quote
Personally I prefer the grey marking that ML currently displays.  I don't need to see the lack of bits being represented the way that rawdigger shows, only that there is simply not enough bits there, and that there is data being contained within.

I would like to see the current histogram shadow area being user adjustable along the lines of the zebra underexposure option.  So as a user I can decide, I don't want any data contained within the bottom three stops, and the grey overlay on the histogram will represent these bottom three stops, and I can then move the data in the histogram as needed with exposure.
Of course we don't want data in the lowest bits but sometimes it is not possible to avoid it. Example: in an outdoors shoot we can't control the fill light in the shadows of the far away trees like we can in a studio. So being able to evaluate that visually is a plus. Don't you think?

The linear zoom on the Y axis in the last stop makes sense - it's easier to judge the clipping status in tricky cases.
What cases? Generally log Y is better. If Y is linear it makes small clippings unnoticeable. Example (using this CR2):

Left - log X/ linear Y; Middle - log X/ log Y; Right - linear X / log Y:


Quote
However, linear scaling on the X axis does not - at least to me. Why?
Just look at the examples. It shows much better the peaks in clipping. Log X smooths it because logarithm naturally compresses the levels horizontally.

Quote
With logarihtmic scaling on X:
- you can always read the offset in EV
- when exposure changes, the entire histogram translates horizontally.
But the whole idea of having bigger histogram of highlights is the visual (human intelligence) evaluation of the shape of the highlights. While shooting we are not really interested in what is in the middle of the histogram and how it translates left or right. We want to maximize the use of the sensor where we have most levels (ETTR), right?

Quote
<CDF, smoothing etc..>
I agree that the raw without smoothing creates cluttering, so it looks better with spreading + smoothing (as long as that doesn't affect accuracy).
CDF... I don't know. Personally I am not used to it (perhaps most people too). It looks like a lot of wasted space is wasted just to display a smooth S-like line which doesn't really say what adjustment of exposure might be needed for ETTR. Perhaps it may be useful for shadows only.

Is it possible to see an example using the CR2 from above showing (similar to my ugly sketch):
Left 1/2 of the graphic: LogX/LogY of shadows (with smoothing)
Right 1/2 of the graphic: LinearX/LogY of highlights (the top 1EV, no smoothing)

I am really curious if this will work.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10439
  • 5D Mark Free
Re: Full-screen histogram WIP
« Reply #12 on: November 01, 2017, 12:50:56 AM »


Quote
But the whole idea of having bigger histogram of highlights is the visual (human intelligence) evaluation of the shape of the highlights. While shooting we are not really interested in what is in the middle of the histogram and how it translates left or right. We want to maximize the use of the sensor where we have most levels (ETTR), right?

Yes, but there are scenes where you have to sacrifice some highlights (think something with strong lights, or any scene where you may want to use Dual ISO). In this case, guess where you have to look - at shadows and midtones!

Look up previous discussions on Auto ETTR, SNR limits and related stuff.

Left and right translation is essential - you'll know how the histogram will look like after adjusting the exposure. At a glance.

Quote
Personally I am not used to it (perhaps most people too)

I'm not used to it either - I've read about it today ;)

Quote
... smooth S-like line which doesn't really say what adjustment of exposure might be needed for ETTR ...

It does! Have you read this?

Quote
Is it possible to see an example using the CR2 from above showing (similar to my ugly sketch):
Left 1/2 of the graphic: LogX/LogY of shadows (with smoothing)
Right 1/2 of the graphic: LinearX/LogY of highlights (the top 1EV, no smoothing)

Linear X is not trivial in the current codebase (the histogram is built with log assumption from the beginning); will leave it as an exercise after committing the code :)

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3444
  • Blunt and to the point
Re: Full-screen histogram WIP
« Reply #13 on: November 01, 2017, 01:20:15 AM »
Thumbs up here for CDF.  Would be handy to have markers.  Perhaps on the right hand side.  Median and 5th percentile?  If you can draw a line from those markers to their position on the graph that would help to have an accurate determination.  Perhaps even allow user adjustment (think SNR limits in ETTR).

It would probably be useful to have a fixed x axis also, to ensure the 'useful' data is displayed with the highest resolution, and we don't just end up with a graph that uses all of the available resolution to display an outlier.  By useful I mean the tail, and being able to see any valley's between clusters*.

Markers on the graph for infinity values would help to make it obvious that infinity has occurred.

You would need to rework the markers on the bottom of the display for CFD mode also, correct?

Thanks for the display top right a1ex (what the initial bugging you was all about).  It is nice to be able to see these things with eyes.

P.S.  If you send through some images when the code is commited, I'll be sure to update the raw based exposure guide asap.

*edit:  hmmm, I'm not sure now.  Being able to visually see that an outlier is present has it's uses also.  Perhaps that outlier is a specular highlight, so then we could adjust exposure as necessary.  And removing the outlier also means that without careful consideration, one may mistake the visual representation of the data, and assume that useful data has not been quashed by specular highlight.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10439
  • 5D Mark Free
Re: Full-screen histogram WIP
« Reply #14 on: November 01, 2017, 01:40:04 AM »
Markers on the bottom? Both CDF and histogram have the same X axis (you can superimpose them if you like). In all the above examples, I'm showing 12 stops below white level.

The zoomed view also shares its X axis with the rest of the graph (that's why it's placed above). Another argument for log X: you can see the specular highlight clipping (in this case you have to clip it, otherwise you'll end up with a really dark image), and you can also evaluate how many stops there are until the non-specular highlights (that you probably don't want to clip).

In this particular image, you can probably push the exposure to the right by one extra stop, without much loss in that specular highlight. I've read the amount from the zoomed view - I couldn't have done that with a linear X.



(simulated a digital ISO push by 1 stop)

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3444
  • Blunt and to the point
Re: Full-screen histogram WIP
« Reply #15 on: November 01, 2017, 03:27:41 AM »


The histogram on the left appears to have data extend to 7.5EV below saturation, the histogram on the right appears to have data that extends to 6.5EV below saturation.

These next two highlight the difference better.




When I look at all of the comparison images you linked, you can clearly see how the data matches between the different histograms.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10439
  • 5D Mark Free
Re: Full-screen histogram WIP
« Reply #16 on: November 01, 2017, 11:19:47 AM »
Yeah, that's the difference between log and linear histograms. CDF is linear - maybe it's worth "compressing" it somehow?

Code: [Select]
octave:1> f = @(x) asin(2 * (x - 0.5)) / pi + 0.5
octave:2> p = [0.01 0.1 1 10 50 90 99 99.9 99.99]'
octave:3> printf("%5.2f -> %5.2f\n", [p, f(p / 100) * 100]')
 0.01 ->  0.64
 0.10 ->  2.01
 1.00 ->  6.38
10.00 -> 20.48
50.00 -> 50.00
90.00 -> 79.52
99.00 -> 93.62
99.90 -> 97.99
99.99 -> 99.36

That would be a nonlinear scale on Y that reveals the small "details" in a way similar to log. I'm not sure how to come up with a well-defined mapping based on pure log (or whether that even makes sense).

It does a much better job at revealing highlights and shadows, but really needs grid lines. You can even "compress" the CDF twice, for "zooming" in the small percentiles even more:
Code: [Select]
octave:4> printf("%5.2f -> %5.2f\n", [p, f(f(p / 100)) * 100]')
 0.01 ->  5.08
 0.10 ->  9.06
 1.00 -> 16.25
10.00 -> 29.90
50.00 -> 50.00
90.00 -> 70.10
99.00 -> 83.75
99.90 -> 90.94
99.99 -> 94.92

Left to right: log histogram, linear CDF, "log" CDF compressed once, "log" CDF compressed twice:







To me, the last one provides at least the same information as the zoomed view! In addition:
- it' not affected by autoscaling (the zoomed view is)
- I can see at a glance the percentage of clipped highlights and noisy shadows (at any noise threshold for the latter)
- it's obvious where the curve starts, and matches the log histogram at that
- it shows tiny changes even better than linear zoom (look closely at first image, top right)

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3444
  • Blunt and to the point
Re: Full-screen histogram WIP
« Reply #17 on: November 01, 2017, 11:43:40 AM »
Hmm, so how does this fit in?



I'm thinking to use markers like in the above image, with the median and minimum representing something similar to ETTR SNR.
This way we could see what data falls below, or lies above the ranges.

But I didn't realise CDF was linear, and it would be nice (I guess) to see how the data falls regarding EV scale, like all of the other ML exposure feedback tools.

Transforming linear to log is significantly above my pay grade.  :P
I can google search.  But still no idea if it helps the current situation.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10439
  • 5D Mark Free
Re: Full-screen histogram WIP
« Reply #18 on: November 01, 2017, 12:36:54 PM »
Here's a picture:



X scaling stays the same (EV), Y gets compressed to reveal the smaller percentiles.

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3444
  • Blunt and to the point
Re: Full-screen histogram WIP
« Reply #19 on: November 01, 2017, 01:29:41 PM »
Thanks a1ex, now it makes sense.  The spike at the right hand side of the clipped compressed CDF graph was throwing me off.  And for some reason I was expecting the shadow area to look different also.

I like it.

heyjoe

  • Freshman
  • **
  • Posts: 54
Re: Full-screen histogram WIP
« Reply #20 on: November 01, 2017, 01:39:32 PM »
Yes, but there are scenes where you have to sacrifice some highlights (think something with strong lights, or any scene where you may want to use Dual ISO). In this case, guess where you have to look - at shadows and midtones!
But if you have to overexpose highlights, then midtones become highlights, so you still evaluate highlights and control how much you overexpose. It is still highlights control, is it not?

Quote
Left and right translation is essential - you'll know how the histogram will look like after adjusting the exposure. At a glance.
That's true. The problem is that we don't have a 30" LCD on the camera to see everything :) So I am just thinking about using the available space for the most critical things. BTW if CDF is used - the exposure movement becomes more complex, not just left/right.

Quote
I'm not used to it either - I've read about it today ;)

It does! Have you read this?
Yes, we also studied that in the university. I just mean that from usability viewpoint it may need special education for the end user :) Also from which picture is it really simpler to evaluate clipping peaks:



Yes, the CDF shows a flat area at the end and for non-clipped ETTR one should aim for not having any flat area on the right but I suppose it needs testing in real conditions. So maybe the best thing to do is to have an option in the menu what to display: histogram or CDF.

Another thing which comes to mind: perhaps with CDF it will be difficult to evaluate shadows due to the log X axis and the linear nature of raw data which always has less values in shadows. Which again comes to screen space - 80% of the CDF (or histogram) displays midtone data which is not critical for exposure control. Won't it be better to have a smaller full CDF/histo and a zoom of the critical areas?

Quote
Linear X is not trivial in the current codebase (the histogram is built with log assumption from the beginning); will leave it as an exercise after committing the code :)
I am sure you know how to make it :)

Markers on the bottom?
Or maybe a thin diagonal straight line?

The zoomed view also shares its X axis with the rest of the graph (that's why it's placed above).
Hm. But what is it zooming then? My initial idea was to have it stretched on both X and Y (damn.. I am repeating myself too much :) ) Another thing: having the vertical clipping line right at the edge of the screen makes it difficult to read. Maybe it needs some spacing. Just imagine shooting in a bright sunny day and having to read all that visual info.

Yeah, that's the difference between log and linear histograms. CDF is linear - maybe it's worth "compressing" it somehow?
I think that compressing CDF in a way which reduces the critical areas (highlights and shadows) is contrary to what we need. It is also contrary to the advantage of CDF to display outliers much better than a histogram.

BTW: How about a new heuristics based on CDF? :)

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10439
  • 5D Mark Free
Re: Full-screen histogram WIP
« Reply #21 on: November 01, 2017, 01:53:28 PM »
Quote
BTW if CDF is used - the exposure movement becomes more complex, not just left/right.

False, see #14. With log scaling on X, the movement is always a translation (one notch on the grid = 1 EV).

Quote
My initial idea was to have it stretched on both X and Y

The current scaling already lets you evaluate the exposure with a resolution of 1/60 EV (if you count pixels), or ~0.1 EV (if you look at it). I don't see the need for further zooming on X.

Quote
BTW: How about a new heuristics based on CDF? :)

Already done... 1 month ago ;)

The exposure hints from Auto ETTR are also CDF-based.

BTW - please try cutting down the "splitting hairs".

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3444
  • Blunt and to the point
Re: Full-screen histogram WIP
« Reply #22 on: November 01, 2017, 02:20:09 PM »
Moved over to mobile, trying to quote specific parts of a large post is retarded.  Hopefully viewers can follow.

The flat areas of the CDF graph indicate areas of no signal.  The reason why there is that large flat area in the highlights in that graph is because of the specular highlight.  There is clipped data, then there is no other data until -1EV.  a1ex posted an example earlier with a simulated 1EV gain of that test image, and the resulting CDF graph.  The principle of the flatness of the CDF graph applies throughout the entire graph.  If the graph tends towards flatness, it translates to limited data in that area.

Compression of the CDF graph does the exact opposite.  It expands the highlights and shadows.

ML is provided free as in beer.

Speaking of the flatness of CDF, perhaps zoomed histogram on top left, with the CDF expanded to fill the vertical space also.  Possibly beginging to be cluttered.  Garry made a good point above, but I guess that needs to wait until that image processing pipeline is fully understood.  I have mentioned how exciting all that backend work you guys have been doing is, right.  qemu has made you even quicker a fancy images  :P

heyjoe

  • Freshman
  • **
  • Posts: 54
Re: Full-screen histogram WIP
« Reply #23 on: November 01, 2017, 05:47:11 PM »
False, see #86. With log scaling on X, the movement is always a translation (one notch on the grid = 1 EV).
Hm. You are right. I didn't think about the X-log.

Quote
The current scaling already lets you evaluate the exposure with a resolution of 1/60 EV (if you count pixels), or ~0.1 EV (if you look at it). I don't see the need for further zooming on X.
Sounds great. Could you at least add a little spacing (few pixels) left and right of the graphics to avoid having vertical lines being placed right at the edge of the LCD?

Quote
Already done... 1 month ago ;)

The exposure hints from Auto ETTR are also CDF-based.
That's great! I guess I was confused because of that:
I'm not used to it either - I've read about it today ;)

Quote
BTW - please try cutting down the "splitting hairs".
Please don't look at it this way. The usability suggestions are based on the actual ETTR tests. BTW what is the function of the small vertical colored ticks?



Compression of the CDF graph does the exact opposite.  It expands the highlights and shadows.
Are you sure? The compressed versions show shorter flat areas for clipped shadows and highlights.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10439
  • 5D Mark Free
Re: Full-screen histogram WIP
« Reply #24 on: November 01, 2017, 07:48:40 PM »
Well, CDF is simply the sum of each bin on the histogram. So, wherever the exposure algorithm sums the bins in either direction, we can say it looks at the CDF.

So, even if I wasn't used with CDF as a visualization tool (until reading the linked article), that didn't stop me from using it in the algorithms (even if I didn't know it was called that way). That's why, back then, I said Auto ETTR computes the exposure by looking at the histogram (which is not wrong either - as the CDF is simply the "integral" of the histogram).

The tiny markers are the medians. Maybe I should find some other representation.

BTW, for your side by side comparison, try this picture:



(reason: both of them have log scaling vertically; we are comparing the two horizontal scaling methods)

From the left picture, from the CDF graph, I can tell:
- there is a specular highlight, less than 0.1% of the image area (this will be more obvious after adding markers)
- there's about 1 stop until the non-specular highlight data on the green channel (so if I decide to clip that highlight, the exposure can be pushed by 1 stop to the right)
- if I decide to capture that specular highlight, I'd have to underexpose by a couple of stops (look at the slope in the flat area)
- a small percentage of the shadows (about 1%) is buried in the noise floor
- midtones are about 5 stops above the noise floor (this lets you evaluate the overall noise levels in the image)
- if I decide to clip that highlight and also sacrifice the green channel (thus relying on highlight recovery), there are about 2/3 additional EV until the non-specular highlights of R and B (you may want to do that if midtones are too low).


From the right picture, I can tell there's a specular highlight clipped.

I can tell nothing about its area (well, I can after doing the "integral" of that peak mentally - is that 2 or 3 pixels wide?)

It's hard to tell how many stops I can move in either direction (to either capture that highlight, or discard it and maximize the SNR in the rest of the image) - I need to transform from linear to log mentally, and as Audionut said, it's not straightforward.

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3444
  • Blunt and to the point
Re: Full-screen histogram WIP
« Reply #25 on: November 02, 2017, 04:04:50 AM »
The tiny markers are the medians. Maybe I should find some other representation.

They look fine here.  Excellent actually, once you know what they represent.  The fact that you have a marker for each color channel, that the spacing between the markers matches the spacing in the highlights, and that the markers are around the middle.................omg, there are those median markers I was asking about.  :)
Just needs a code push so that I can document it.  :D  Then RTFM becomes relevant.

It's amazing how much exposure data you have in that last qemu image.

I'm wondering how good my copy paste skills are.  I'm thinking I should be able to pinch dmilligan's zebra underexposure code and apply it to the (shaded area of the) histogram.  But I haven't looked, I'm just guessing as per usual.  edit:  I should stop trying to use up more available time then I have, and stick to updating a few things around the forum first.

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3444
  • Blunt and to the point
Re: Full-screen histogram WIP
« Reply #26 on: November 02, 2017, 02:20:44 PM »
I'm starting to question the pros/cons with compressing the CDF graphs.  Truth be told, I think I'm starting to question how I look at histograms.

Lets look at log and linear histograms of this image.  I've put grid lines at 1/3EV, and saturation occurs at 2 and 2/3EV (close enough), easy to see on the log scale.  Scaled to around 12EV, which is what ML displays via the markers at the bottom of the screenshots.



Now the log histogram, linear CDF and compressed CDF as displayed by ML.


I'll make a note here that one of the tactics used by CDF to represent data is the vertical scale.  So what is clear to see is how the linear and compressed CDF graphs do accurately represent linear and log histograms.

I was having a panic attack earlier, because the noise floor area of the log histogram and linear CDF above are remarkably different.  But after slapping myself sideways and remembering that the log graph over exaggerates the number of pixels (from a visual perspective), I'm ready to completely reverse  how I look at these things.

You may (I know I did) look at the log histogram and say, omg, look how much data is below the noise floor, and then look at the linear CDF and think, meh, it's not that much.  Lets let images tell the story.

Here is an image with underexposure indicators (blue shading) set to 10.6EV below saturation (the same value that ML reports).


When I look at this image I think, meh, it's not that much.  If you add up the percentages of underexposed pixels from all of the color channels, 1.7%.
So I've harped on about a general consensus of acceptable noise in images being 2EV above the noise floor of the camera.  As a marker on the linear CDF image, this places the noise floor mark around here.


Suddenly the linear CDF graph seems to more accurately represent the number of 'noisy' pixels.  There's more of the linear CDF data in the 'noisy' zone.  On the left is an image with underexposure indication set to 8.6EV below saturation (10.8% of pixels).  And on the right with underexposure indication set to 7.6EV below saturation (24.5% of pixels), where the CDF graph really begins to go vertical (the vertical aspect being an important aspect of CDF).  Although to be fair, the log histogram goes vertical here also (third image in this post).


Going back to the two images that I took issue with earlier, this time with a marker on the linear CDF graph 2EV above the noise floor.


I guess when I consider the amount of 'noisy' pixels, and not simply the amount of pixels completely buried in the noise floor, I stop having a panic attack about the 'lack of' shadow detail in the linear CDF graphs, and when remaining as linear, rather then compressed, the CDF graphs retain the valuable vertical detail (especially in the midtones).



TLDR:  CDF is probably linear for a reason.  Maybe we should leave it alone.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10439
  • 5D Mark Free
Re: Full-screen histogram WIP
« Reply #27 on: November 02, 2017, 02:49:24 PM »
On shadows, you are generally interested in "large" percentiles - that are well represented on the linear CDF. Example: 1/4 of the image (25%) is "too noisy".

On highlights, you usually want to check the specular highlights. If you consider a highlight covering 1% of the image area, that area is quite large - divide the image by 10 horizontally and vertically, and one such square has 1% of the area.

1% on the CDF is about 2-3 pixels on the screen. 10% is clearly noticeable, and when evaluating shadows, it's a good choice.

The specular highlights from E5D3LL0001005.CR2 have a total area of about 6000 pixels out of 3870x5796 - that gives 0.027%. On the camera screen, that's about 90 pixels (so not exactly negligible - I'd like to know about such highlight in the first flower image, for example). Good luck noticing it on the linear CDF ;)

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3444
  • Blunt and to the point
Re: Full-screen histogram WIP
« Reply #28 on: November 02, 2017, 03:04:06 PM »
I did think about some sort of blended CDF.  Compressed in the highlights and shadows, and linear through the midtones, but forgot to mention it in my wall of text.

You do have a valid point about the flower image, you do need to look closely to see the overexposure, but I like to think that the zoomed histogram covers this highlight area well.
The linear CDF on this image clearly shows the underexposure in the red channel, the compressed version seems to be inaccurate.  Didn't even realise this until you pointed it out :P

edit:  You're planned markers on the right, if I understand correctly will probably help to show an accurate representation of this underexposure.  But then it's back to mental calculation I suppose.  I think I'm starting to nitpick.  Goodnight.

edit again:  The compressed CDF does seem to match the histogram better in the red channel.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 10439
  • 5D Mark Free
Re: Full-screen histogram WIP
« Reply #29 on: November 02, 2017, 09:11:39 PM »
Some examples with markers:








Showing 12 stops below 16383. A small space appears on the right because the white level is usually a bit lower (about 13000 - 15000).

Grid lines at  0.1, 1, 10, 50, 90, 99 and 99.9%.

Median marker is 5 stops above the noise floor, shadow markers are at 2 stops above (more or less arbitrary choices).

heyjoe

  • Freshman
  • **
  • Posts: 54
Re: Full-screen histogram WIP
« Reply #30 on: November 02, 2017, 11:57:58 PM »
It's getting better and better :)

Some examples with markers:
Could you please explain how we would use those while shooting?

BTW the white rectangles can be visually problematic: imagine shooting architecture - a building with lots of small white tiles or something else with repeating pattern.

Quote
Showing 12 stops below 16383. A small space appears on the right because the white level is usually a bit lower (about 13000 - 15000).
That offset is what I was asking for previously. Makes things much more readable. If you can add it globally left and right it would be great.

Another thing: having channel histograms on top of each other makes it a little difficult to say which channels are clipped and which not. Sometimes one may want to clip one channel but not another. How about an option to have them separate (below each other)? Also considering there is so much space on top and left and bottom right of the CDF it seems to me the display can be optimized by using a non-uniform X log scale, i.e. bottom and top 2-3EV stretched horizontally and what lies in the middle more compressed. Then the CDF can be stretched to the top (with small edge offset) and place a huge zoom of the shadow and highlights histograms on top left and bottom right. Quick sketch:



What do you think?

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3444
  • Blunt and to the point
Re: Full-screen histogram WIP
« Reply #31 on: November 06, 2017, 08:52:36 AM »
Split this topic from link in op.  Cleaned out some of the off-topic (I have my hand raised) and gave a1ex OP.

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 3044
  • 5D3 / M1 / 7D / 70D / SL1
Re: Full-screen histogram WIP
« Reply #32 on: November 10, 2017, 06:05:09 PM »
...Could you at least add a little spacing (few pixels) left and right of the graphics to avoid having vertical lines being placed right at the edge of the LCD?

+1
5D3.113 • 5D3.123 • EOSM.203 • 7D.203 • 70D.112 • 100D.101

D_Odell

  • Member
  • ***
  • Posts: 180
Re: Full-screen histogram WIP
« Reply #33 on: November 10, 2017, 10:15:53 PM »
This is excellent! Is it hard for the cpu?
5D3 (OLPF removed) :: 1.1.3 :: Canon FD L Serie