Magic Lantern Forum

General Discussion => General Chat => Topic started by: Imax on August 13, 2017, 04:14:52 AM

Title: Histogram... bottom to top
Post by: Imax on August 13, 2017, 04:14:52 AM
Talking about histograms...
Histogram is a XY table/chart
X... is 255 tones of light (black to white)
Y... is the amount of pixels of every one of those 255 tones
Bottom is no pixels top is lot of pixels
But HOW MANY PIXELS?
How much is lots? How much is needed to get to the top of the chart? Y axis is the number of pixels... how many pixels are from the bottom of the chart to the top of the chart? What if the line reach the top?
Title: Re: Histogram... bottom to top
Post by: masc on August 13, 2017, 06:09:35 PM
I asked me the same question some days ago. I normalized the height, so the full height is the maximum count. Downside: if there are many pixels with the same color, you have peaks. Sometimes this peaks are so high, that you can't see the other colors.
Title: Re: Histogram... bottom to top
Post by: a1ex on August 13, 2017, 07:32:40 PM
Quote from: masc on August 13, 2017, 06:09:35 PM
Sometimes this peaks are so high, that you can't see the other colors.

That's where the log histogram comes in (on the Y axis). See http://web.cs.wpi.edu/~emmanuel/courses/cs545/S14/slides/lecture02.pdf p.7.

On the X axis, ML's raw histogram is always logarithmic (in EV). The YUV-based histogram (for JPG/H.264) is linear (0-255), but its input is a gamma-corrected image. See http://www.guillermoluijk.com/tutorial/histogrammar/index_en.htm.
Title: Re: Histogram... bottom to top
Post by: masc on August 13, 2017, 10:25:17 PM
Thanks Alex! I played around: log y axis looks very flat, linear has hard peaks. When I mix both together it looks not that bad... something like that:
output = factor1 * log( input ) + factor2 * input
Is it okay to do something like that?!
Title: Re: Histogram... bottom to top
Post by: a1ex on August 13, 2017, 11:12:34 PM
I'm not aware of any software that would display a histogram in this way, but if you find it more readable than either linear or log, it could be interesting.

If you want the graph to be non-ambiguous, you could draw some tick marks that would show the Y scaling.

Here I've used some non-standard Y scaling for some plots (neither linear, nor log - it was derived from 1/x): http://www.magiclantern.fm/forum/index.php?topic=4997.msg175314#msg175314.