Calculating an image histogram

We are one step closer to understanding the image content, and one of the fundamental image analysis techniques is calculating the image histogram.

What are histograms?

Histograms are plots used to give you an overall idea about the distribution of the intensity values of a given image. In the x axis, the plot will have values ranging from 0 to 255 depending on the image depth as explained earlier and the y axis will represent the number of occurrences of the corresponding intensity value.

Once you calculate and display the histogram of an image, you can easily gain some insights about the image contrast, intensity distribution, and so on. Actually, if you normalize the histogram, making it sum to one, you can treat ...

Get OpenCV Android Programming By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.