Should we tweak the histogram display? - General Help and Assistance on using CHDK stable releases - CHDK Forum

Should we tweak the histogram display?

  • 12 Replies
  • 1993 Views
Should we tweak the histogram display?
« on: 10 / May / 2022, 07:21:28 »
Advertisements
@reyalp

As you will see on another post, I've successfully added an ETTR Meter to my M3 script.

In doing this I wondered if we should tweak the histogram and rather than the grid lines simply being on or off, we add in the option to show the lines linearly, as now, or as stops?

If stops then I suggest we 'only' show the top 6 or so stops down from the highlights.

The relevant code in histogram.c is, I believe this:

Code: [Select]
//Vertical Lines
    if (conf.histo_show_ev_grid) for (i=1;i<=4;i++) draw_line(x+(1+w)*i/5, y, x+(1+w)*i/5, y+h, FG_COLOR(conf.histo_color2));

If drawing stops the positions would be at 186.8, 136.3, 99.4, 72.6, 53 (down from the highlights at 256), as opposed to at i/5. The sequence continues but gets more compressed, ie 38.6, 28.2, 20.6.
« Last Edit: 11 / May / 2022, 02:39:25 by pigeonhill »

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Should we tweak the histogram display?
« Reply #1 on: 12 / May / 2022, 19:39:29 »
If drawing stops the positions would be at 186.8, 136.3, 99.4, 72.6, 53 (down from the highlights at 256), as opposed to at i/5. The sequence continues but gets more compressed, ie 38.6, 28.2, 20.6.


While the values provided may work for the M3, I doubt they would be consistent across all cameras.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline reyalp

  • ******
  • 14082
Re: Should we tweak the histogram display?
« Reply #2 on: 12 / May / 2022, 21:17:30 »
While the values provided may work for the M3, I doubt they would be consistent across all cameras.
We know there's at least cameras which use the full 8 bit range, and ones that use 16-237 ish.

Given the underlying details are not actually known to us, my feeling is there wouldn't be much value trying to make the "stops" more precise. I'd take the CHDK histogram as a general indicator (a peak is near the middle or at one the extremes etc) not something you should expect to make precise calculations from.

edit:
I'm open to being convinced otherwise if you have a specific use case that would really benefit from different tick marks.

Some previous discussion of the range issues in this thread https://chdk.setepontos.com/index.php?topic=14342.msg146177#msg146177
« Last Edit: 12 / May / 2022, 21:20:55 by reyalp »
Don't forget what the H stands for.

Re: Should we tweak the histogram display?
« Reply #3 on: 13 / May / 2022, 02:07:28 »
@reyalp @philmoz

Based on what you say, I agree, not worth the effort.

Best left to the user exploiting Lua get_live_histo and creating their own ‘feedback’, as I have tried to do in the M3 script.

Plus this conversation should alert CHDK users to the stop distribution, ie the impact of gamma coding.

Maybe worth adding a line or two to the CHDK Histo section of the manual, ie flagging that  vertical bars are not stops?

Cheers

Garry



Re: Should we tweak the histogram display?
« Reply #5 on: 14 / May / 2022, 01:10:56 »
@reyalp

Obviously I’m not going to ‘challenge” your rewording of my rewording of the CHDK manual for the Histo grid ;-)

I will say, however, I don’t believe is correct to say they are Ev divisions.

*

Offline reyalp

  • ******
  • 14082
Re: Should we tweak the histogram display?
« Reply #6 on: 14 / May / 2022, 01:37:23 »
I will say, however, I don’t believe is correct to say they are Ev divisions.
The section titles in the manual should match the actual menu text in CHDK, which currently includes "Ev". We could change both, but from my testing the grid steps are close enough to Ev steps that it's reasonable to describe them that way. Attached is from -2 to +2 ev shift in the Canon UI on sx730. Yes, it's not scientifically calibrated, but one stop of Ev shift moves the peak approximately one grid slot.
Don't forget what the H stands for.

Re: Should we tweak the histogram display?
« Reply #7 on: 14 / May / 2022, 01:55:33 »
@reyalp

Your call.

The gamma encoded viewport throws things out more towards the shadow end.

Bottom line: for the ‘casual’ user this is not going to ruin their day. For those that want to get a bit more out of the histogram, then they will likely be aware of the non-linear, gamma skewness.


Re: Should we tweak the histogram display?
« Reply #8 on: 14 / May / 2022, 06:02:33 »

Re: Should we tweak the histogram display?
« Reply #9 on: 15 / May / 2022, 12:00:27 »
@reyalp

When you find yourself with a few minutes spare, ;-), I would be grateful if you could explain the following code in histogram.c

Code: [Select]

if (histo_max[HISTO_RGB] > 0) { // over- / under- expos
                under_exposed = (histogram_proc[HISTO_RGB][0]*8
                                +histogram_proc[HISTO_RGB][1]*4
                                +histogram_proc[HISTO_RGB][2]) > exposition_thresh;

                over_exposed  = (histogram_proc[HISTO_RGB][HISTO_WIDTH-3]
                                +histogram_proc[HISTO_RGB][HISTO_WIDTH-2]*4
                                +histogram_proc[HISTO_RGB][HISTO_WIDTH-1]*8) > exposition_thresh;
            } else {
                over_exposed = 0;
                under_exposed = 1;
            }


I don’t get the *4 and *8 bit in the code, ie looking at the top or bottom three bins of the histogram.

Cheers

Garry

 

Related Topics