Aishwariya Gupta
3 min readFeb 1, 2019

I am new to this field, and through these series of articles, I will attempt to clear the basic topics behind the huge area which is being developed each day.

HISTOGRAM

So what exactly is a histogram? It is a visual representation of numerical data showing a number of data points falling within a range of specified range of values

Since an image is also represented as data points, histogram is a very good way to view the image and analyze as to where exactly the intensities in an image is concentrated at.

It is a plot between pixel intensity and the number of pixels present in a particular image.

For computations and image processing algorithms, gray scale image is always preferred.

Histogram represents an image in its gray levels where gray levels vary from [0, L-1] where L = 2^k , k is the number of bits of the image. It shows a plot of number of pixels present in an image having a particular gray level.

Example: an 8 bit image will have its gray level vary from [0,255].

The picture below will make the explanation more clear

Example:

Histogram of a 8 bit black and white image

Color Image Histograms

For a color image, two processes can be followed as per your requirement

  1. Change the color image to black and white image and then plot the histogram
  2. RGB ( Red , Blue and Green )color components can be extracted from the image and the histogram can be plotted

A color image can be represented in a way like this

Example:

Histograms of respective color components

For better practices, it is advisable to NORMALIZE THE HISTOGRAM which is done simply dividing each of its values by total number of pixels in the image. It is then represented as a probability function which gives an estimate of probability of occurrence of a gray level.

HISTOGRAM MATCHING OR HISTOGRAM SPECIFICATION is the process wherein you have a specified(target image’s) histogram, and the input’s histogram to it.

Few points to remember:

  1. Histogram does not give the location of a pixel
  2. Different images can have same histogram but distribution of intensities can be different
  3. We can never reconstruct an image by a histogram.

Hope your basic doubts are cleared. If there is anything more you would like to know, be free to comment below.