Showing posts from December, 2012

Histogram equalization using OpenCV

In image processing Histogram can be considered as the graphical representation of pixel value versus the pixel count. For example an 8 bit single channel gray-scale image histogram might be a 2-D graph of X axis with pixel value and Y axis with pixel count. Histogram equalization is the contrast adjustment using histogram of image. This method is useful when the image information is poor that is foreground and background both are dark or over exposed. The image below shows what we actually do with the histogram equalization. 
        Histogram equalization improves the contrast of an image by stretching it's intensity range. On the below image the first plot represent the histogram of the low contrast source image and on the second one is the histogram after equalization. So it is clearer that the Histogram equalization just stretch out the intensity range.

    OpenCV has inbuilt function for doing histogram equalization, like equalizeHistwhich has two arguments, sourc…