OpenCV
Open Source Computer Vision
|
Prev Tutorial: Affine Transformations
Next Tutorial: Histogram Calculation
In this tutorial you will learn:
To accomplish the equalization effect, the remapping should be the cumulative distribution function (cdf) (more details, refer to Learning OpenCV). For the histogram
To use this as a remapping function, we have to normalize
Finally, we use a simple remapping procedure to obtain the intensity values of the equalized image:
As it can be easily seen, the only arguments are the original image and the output (equalized) image.
To appreciate better the results of equalization, let's introduce an image with not much contrast, such as:
which, by the way, has this histogram:
notice that the pixels are clustered around the center of the histogram.
After applying the equalization with our program, we get this result:
this image has certainly more contrast. Check out its new histogram like this:
Notice how the number of pixels is more distributed through the intensity range.