/HistogramEqualization

This is a histogram equalization version based on python&openCV.

Primary LanguagePython

Histogram Equalization

Introduction

Histogram equalization is a method in image processing of contrast adjustment using the image's histogram. This method usually increases the global contrast of many images, especially when the usable data of the image is represented by closecontrast values. Through this adjustment, the intensities can be better distributed on the histogram. This allows for areas of lower local contrast to gain a higher contrast. Histogram equalization accomplishes this by effectively spreading out the most frequent intensity values. This is a histogram equalization version based on python&openCV.

Dependency

  1. numpy
  2. opencv
  3. PIL

Demo

python hist_equal.py --Input xx.jpg --Output xx.jpg

Example

origin image

new image

Reference

FINLAYSON, G., HORDLEY, S., SCHAEFER, G., & YUNTIAN, G. (2005). Illuminant and device invariant colour using histogram equalisation. Pattern Recognition, 38(2), 179–190. doi:10.1016/s0031-3203(04)00185-2