|
Data Fields |
| unsigned long | frame |
| unsigned long | valid |
| | frame number correspoding to the current histogram
|
| union { |
| unsigned long gtab [4] |
| struct { |
| unsigned long gtab_r |
| unsigned long gtab_g |
| unsigned long gtab_gb |
| unsigned long gtab_b |
| } | |
| }; | |
| | Gamma tables hash values for the frame of the histogram.
|
| union { |
| unsigned long hist [1024] |
| struct { |
| unsigned long hist_r [256] |
| unsigned long hist_g [256] |
| | Histogram for the red component.
|
| unsigned long hist_gb [256] |
| | Histogram for the first green component (in the "red" line).
|
| unsigned long hist_b [256] |
| | Histogram for the second green component (in the "blue" line).
|
| } | |
| | All 4 histograms.
|
| }; | |
| | Direct histograms, loaded from the FPGA.
|
| union { |
| unsigned long cumul_hist [1024] |
| struct { |
| unsigned long cumul_hist_r [256] |
| unsigned long cumul_hist_g [256] |
| | Cumulative histogram for the red component.
|
| unsigned long cumul_hist_gb [256] |
| | Cumulative histogram for the first green component (in the "red" line).
|
| unsigned long cumul_hist_b [256] |
| | Cumulative histogram for the second green component (in the "blue" line).
|
| } | |
| | All 4 cumulative histograms.
|
| }; | |
| | Direct cumulative histograms, calculated from the loaded from the FPGA.
|
| union { |
| unsigned char percentile [1024] |
| struct { |
| unsigned char percentile_r [256] |
| unsigned char percentile_g [256] |
| | percentile for the red component
|
| unsigned char percentile_gb [256] |
| | percentile for the first green component (in the "red" line)
|
| unsigned char percentile_b [256] |
| | percentile for the second green component (in the "blue" line)
|
| } | |
| | All 4 percentiles.
|
| }; | |
Calculated reverse cumulative histograms (~percentiles) - for the given 1 byte input X (0 - 1/256 of all pixels, ..., 255 - all pixels) returns threshold value P (0..255), so that number of pixels with value less than x is less or equal to (P/256)*total_number_of_pixels, and number of pixels with value less than (x+1) is greater than (P/256)*total_number_of_pixels, P(0)=0, P(256)=256 /not included in the table/ percentiles arrays are calculated without division for each element, interpolation (with division) will be done only for the value of interest on demand, in the user space. NOTE: - argument is _output_ value (after gamma-correction), reverse gamma table is needed to relate percentiles to amount of light (proportional to exposure)