Documentation


The C++ interface for histogram. More...
array  histogram (const array &data, unsigned nbins) 
Histogram takes in the input array data and computes the minimum and maximum of the range. More...  
array  histogram (const array &data, unsigned nbins, float min, float max) 
This function takes in the input array data . More...  
The C++ interface for histogram.
A histogram is a representation of the distribution of data in an image. This representation is essentially a graph consisting of the data range or domain on one axis and frequency of occurence on the other axis. All the data in the domain is counted in the appropriate bin. The total number of elements belonging to each bin is known as the bin's frequency.
The regular histogram function creates bins of equal size between the minimum and maximum of the input data (calculated internally). The histogram minmax function takes input parameters minimum and maximum, and divides the bins into equal sizes within the range specified by min and max parameters. All values less than min in the data range are placed in the first (min) bin and all values greater than max will be placed in the last (max) bin.
Data normalization via histogram equalization
array af::histogram  (  const array &  data, 
unsigned  nbins  
) 
Histogram takes in the input array data
and computes the minimum and maximum of the range.
This range is then divided up into nbins
number of equally spaced bins. In the output array, the index represents the bin number and the value at the index represents the frequency of the data in that bin. For all elements, the bin it belongs to is computed and incremented.
[in]  data  input data 
[in]  nbins  Number of output bins to populate 
array af::histogram  (  const array &  data, 
unsigned  nbins,  
float  min,  
float  max  
) 
This function takes in the input array data
.
It uses the min
and max
to divide create an output array consisting of nbins
number of equally spaced bins between min
and max
. In the output array, the index represents the bin number and the value at the index represents the frequency of the data in that bin. For all elements, the bin it belongs to is computed and incremented. All elements less than min are placed in the min bin and all elements greated than max are placed in the max bin.
[in]  data  input data 
[in]  nbins  Number of bins to populate between min and max 
[in]  min  minimum bin value (accumulates inf to min) 
[in]  max  maximum bin value (accumulates max to inf) 