An image histogram is the representation of the tonal distribution in a digital image. It counts the number of pixels for each tonal value. For more information, see [1].
Input
Parameters
Output
start = 0
end = 256
numBins = 256
Implementation
This algorithm partitions the distribution into a number of bins and counts the number of occurrences of each pixel value within the bins.
A pixel with intensity 'i' will result in incrementing histogram bin \(b_i\) where
The histogram result from CPU and CUDA backends do not match in some corner cases because these backends perform floating point calculations differently. Floating point calculations on CPU and CUDA are gauranteed to be the same only to some level of precision. These minor difference may cause bin indexes to be calculated differently. For example, when start = 0, end = 245, number of bins = 50, in case of pixel value = 147, the CPU backend will return bin index = 30 while CUDA backend will return bin index = 29.999998.
C API functions
For list of limitations, constraints and backends that implements the algorithm, consult reference documentation of the following functions: