A histogram is a very important property of an image as it provides a global description of the appearance of that image. An enormous amount of information can be obtained from the histogram. It represents the relative frequency of occurrence of gray levels in an image. It is basically a plot of gray levels on the X-axis and the number of pixels in each gray level on the Y-axis. If the histogram is concentrated on the left side then the image will be very dark and if it is concentrated on the right side, then the image will be very bright. It should be evenly distributed for good visual quality of an image.
The following image demonstrates histograms for dark, bright, and normal images:
OpenCV provides a function to calculate the histogram of an Image. The syntax of the function is as follows:
void cv::cuda::calcHist ( InputArray...