CS6825: Computer Vision word cloud

Histograms and Their Meanings

Historgram is a kind of metric you can calculate that tells you information about the pixels in the image. A histogram tells you the number of pixels that have any particular value. So, in a sense it measures the frequency of a particular pixel value.

In the case of greyscale images, you calculate the number of pixels that have each possible grey value starting and 0 and ending at 255. You can also calculate the histograms for color images. Many times for color images, three histograms will be generated, one for red, one for green and one for blue.

h(x) = number of pixels ("frequency in chart below") that have the value x.

Algorithm to calculate

for (each pixel p in the image )
      h(value of p) += h(value of p)

Pseudo Code to calculate Histogram

L=#quatization levels (256 if greyscale)



for (j=0 to L)

  h(j) = 0;





for (r=1 to RowSize)

  for(c=1 to ColumnSize)



    {   greyvalue = f(r,c);

        h(greyvalue) = h(greyvalue) + 1;

    }

      



For example, suppose we have the following greyscale image:
small image

Using the previous algorithm, initially,
h(0)=h(1)=h(2)=......=h(255)=0



Step 1: 



greyvalue = 33 



h(33) = h(33)+1 = 0+1 =1



Step 2: 



greyvalue = 62 



h(62) = h(62) + 1 = 0 + 1 = 1 



Step 3: 



greyvalule=0 



h(0) = h(0) +1 = 0 + 1 = 1



Step 4: 



greyvalue = 9 



h(9) = h(9) + 1 = 0 + 1 = 1



Step 5: 



greyvalue = 255 



h(255) = h(255) +1 = 0 + 1 = 1



Step 6: 



greyvalue = 33 



h(33) = h(33) + 1 = 1 + 1 = 2

      


      
histogram

SOME options with color images, convert to greyscale and then create the histogram OR
as shown below calculate 3 histograms, one for each color field.

full color grey Intensity Historgram

Red Image

RED Channel

red histogram

Red Channel Histogram

 

 

Meaning of Histograms

Dark Image Histogram   Bright Image Histogram
bright image                      bright image

 

Low Contrast Histogram   High Contrast Histogram
low contrast bright image

              

Various Images and their histograms (greyscale)

dark image historgram
light image light image histogram

                                      

   

 

 

 



 

 

© Lynne Grewe