This OpenCV-compatible image improvement module applies different filters to improve the quality of images. It works especially well with grayscale photos. It uses gamma correction to keep the image from being too dark, histogram equalization to boost contrast, and a median filter to remove noise.
Prerequisites for running the code are:
Python =3.5
python-opencv =4.2.0
scipy =1.3.1
or
pip install opencv-python
pip install scipy
- Utilize the median_filter to remove noise from a grayscale image.
- Apply CLAHE (Contrast Limited Adaptive Histogram Equalization) for histogram equalization of the image.
- Enhance sharpness and contrast of the images.
- Employ gamma correction to prevent darkening of the images.
Inside the project's directory run:
python image_enhancement.py
You can find sample images in the Dataset folder and results can be generated in Results folder.
These code works better for gray scale images.
#vrajsoni #vrajsoni.com # umass #umassbeacon #beacon #umassboston #