This project is to implement histogram equalization with Python. You can put the target image in folder ./src
and set the configurations in ./config
. For details, please refer to the comments in the codes.
For the example image, I decreased the brightness of the original image and converted it to grayscale.
Input image | Output image |
The following two plots compare the PDF (Probability Density Function) and CDF (cumulative distribution function) of input and output images.
As you can see, after applying the histogram equalization, the pixel intensity distribution (PDF) becomes more dispersed. And the CDF is uniformly distributed.
CDF | |
Python 3.9.6
MacOS 12.6
-
Install the dependencies
pip install -r requirements.txt
-
Update the
config.py
if needed -
Run the
main.py
python main.py