Frame Histogram Info

 

We keep an "histogram" dataset fro each frame.  This information is kept in a user buffer with ID=ID_HISTOGRAM.  This buffer contain an "Histogram" structure.  These methods are used bu the "Histogram" tool of the SliceO_Tool library.

 

 

Public:

Histogram_Get

Return the "Histogram" structure of the histogram associated with this frame.

Histogram_Delete

Delete the histogram and free all associated memory.

Histogram_Compute

Compute the "Histogram" values for the frame. This function is already indirectly called by "Histogram_Get" if the histogram values do not exist.  You do not need to call it from any user modules.

 

 

The Histogram structure:

 

The histogram is composed of "bins_nb" bins (default = 256) that contain the number of pixels in the frame that have values corresponding to their bin.  The bins values start at "bin_start", each bin is "bin_width".  so the values covered by the first bin are: "bin_start" to "bin_start + bin_width", the second bin goes from "bins_start + bin_width" to "bin_start + 2*bin_width", etc...

 

The number of pixels for each bins are kept in the array "bins" is the image is monochrome.  For color images, the 4 pointers: "red", "grn", "blu" and "max" each point to a buffer containing an array of "bins_nb" unsigned integers.

 

The greatest of all the bins value is kept in "bins_max".

 

 

typedef struct  Histograms {

 

 

          unsigned short          bins_nb ;

 

 

          float          bins_start ;

 

 

          float          bins_width ;

 

 

          unsigned int          bins_max ;

 

 

          unsigned int          *red ;          

 

 

          unsigned int          *grn ;

 

 

          unsigned int          *blu ;

 

 

          unsigned int          *max ;

 

 

          unsigned int          bins[1] ;

 

 

} Histograms ;