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

Should we tweak the histogram display?

  • 12 Replies
  • 2789 Views
*

Offline reyalp

  • ******
  • 14125
Re: Should we tweak the histogram display?
« Reply #10 on: 15 / May / 2022, 14:06:06 »
Advertisements
I don’t get the *4 and *8 bit in the code, ie looking at the top or bottom three bins of the histogram.
FWIW, the original histogram code predates my involvement with CHDK. My guess is that is intended to put more "weight" on the extreme ends, so for example it takes fewer pixels in the 0 bin to trigger the under-exposure warning than in the 1 bin. If there's any more specific reasoning behind the particular numbers used, I don't know what it is.
Don't forget what the H stands for.

Re: Should we tweak the histogram display?
« Reply #11 on: 15 / May / 2022, 14:29:51 »
@reyalp


Thanks for that.


I won’t say it makes sense ;-)


Cheers


Garry

*

Offline Caefix

  • *****
  • 948
  • Sorry, busy deleting test shots...
Re: Should we tweak the histogram display?
« Reply #12 on: 16 / May / 2022, 10:08:17 »
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,
Quote
ie looking at the top or bottom three bins
of the histogram.
;)... I would say, outer left and right 3 columns of the histogram, but maybe we mean the same...  :)

Edit: this little tweak could save some CPU-cycles, but it´s called quite often. ::)
Code: [Select]
int clip(int v);
inline int clip(int v)
{
    if (v<1) return 0;
    return v<255 ? v:255;
}
« Last Edit: 16 / May / 2022, 11:08:26 by Caefix »
All lifetime is a loan from eternity.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal