Histogram equalization is to adjust the distribution of gray histogram, the gray value in the original image is mapped to a new value. The visual representation of the mapping results is that the distribution of the gray scale is uniform, from 0 to 255, and not as concentrated as the original image. The image shows that the contrast becomes larger, brighter and darker.
The mapping algorithm calculates the cumulative function of the gray scale graph and normalized it. Finally, a new gray value is mapped by the cumulative function. This algorithm is described in other blogs. I'm here to talk about my understanding of this algorithm.
What is the effect of this algorithm? First, the size of the grayscale relationship does not change, but the new grayscale range is related to the number of pixels in this grayscale. Pixels that originally occupy low regions and high regions, although few, occupy the vast majority of the (0~255) range. After equalization, the gray area with a low pixel value will occupy a very small portion. The interval between gray values with a large number of pixels is pulled apart. The light and shade of this image is very different.
The understanding of the equalization algorithm of histogram in OPENCV