It is true that the background contrast has improved after histogram equalization. For example, below image shows an input image and its result after global histogram equalization. The first histogram equalization we just saw, considers the global contrast of the image. Where there is large intensity variations where histogram covers a large region, ie both bright and dark pixels are present.ĬLAHE (Contrast Limited Adaptive Histogram Equalization) Histogram equalization is good when histogram of the image is confined to a particular region. So now you can take different images with different light conditions, equalize it and check the results. Its input is just grayscale image and output is our histogram equalized image. OpenCV has a function to do this, cv.equalizeHist. Of faces are histogram equalized to make them all with same lighting conditions. For example, in face recognition, before training the face data, the images As a result, this is used as a "reference tool" to make all images with same
We will get almost the same image as we got. Next we calculate its histogram and CDF as before, and result would look likeĪnother important feature is that, even if the image was a darker image (instead of a brighter one we used), after equalization That is what histogram equalization does.įirst we find the minimum histogram value (excluding 0) and apply the histogram equalization equation as given in Wikipedia.Īt this point we would have the look-up table that gives us the information on what is the output pixel value for every input
Get set face color of histogram matlab 2019a full#
Maps the input pixels in brighter region to output pixels in full region. For that, we need a transformation function which You can see histogram lies in brighter region. It has a very good explanation with worked out examples. Refer to the Wikipedia page on Histogram Equalization for more details about it. This normally improves the contrast of the image.
This histogram to either ends (as given in below image, from Wikipedia) and that is what Histogram Equalization does (in simple But a good image will have pixels from all regions of the image. CLAHE (Contrast Limited Adaptive Histogram Equalization)Ĭonsider an image whose pixel values are confined to some specific range of values only.