Histogram calculation wrapped inside a function.
Cleaner wrapping of histogram calculation functions
Special case for grayscale image histograms