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: |
Return the "Histogram" structure of the histogram associated with this frame. |
|
Delete the histogram and free all associated memory. |
||
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".