cv.equalizeHist - MATLAB File Help |
Equalizes the histogram of a grayscale image
dst = cv.equalizeHist(src)
src
.The function equalizes the histogram of the input image using the following algorithm:
Calculate the histogram H
for src
.
Normalize the histogram so that the sum of histogram bins is 255.
Compute the integral of the histogram:
Hp(i) = sum_{0 <= j < i} H(j)
Transform the image using Hp
as a look-up table:
dst(x,y) = Hp(src(x,y))
The algorithm normalizes the brightness and increases the contrast of the image.