python implementation of the paper: "Efficient Image Dehazing with Boundary Constraint and Contextual Regularization"
Please use this web-app to upload your image and understand what parameters work best for your use case:
https://utkarsh-deshmukh-streamlit-image-dehaze-run-haze-removal-vo1yua.streamlit.app/
Hope it helps you use the library more efficiently 🍾
pip install image_dehazer
Usage:
$ import image_dehazer # Load the library
$ HazeImg = cv2.imread('image_path') # read input image -- (**must be a color image**)
$ HazeCorrectedImg = image_dehazer.remove_haze(HazeImg) # Remove Haze
$ cv2.imshow('input image', HazeImg); # display the original hazy image
$ cv2.imshow('enhanced_image', HazeCorrectedImg); # display the result
$ cv2.waitKey(0) # hold the display window
airlightEstimation_windowSze=15
boundaryConstraint_windowSze=3
C0=20
C1=300
regularize_lambda=0.1
sigma=0.5
delta=0.85
showHazeTrasmissionMap=True
- Go to the src folder
- run the file "example.py"
- sample images are stored in the "Images/" folder
- Output images will be stored in the "outputImages/" folder
1.numpy==1.19.0
2.opencv-python
3.scipy
This code is an implementation of the paper "Efficient Image Dehazing with Boundary Constraint and Contextual Regularization" The algorithm can be divided into 4 parts:
- Airlight estimation
- Calculating boundary constraints
- Estimate and refine Transmission
- Perform Dehazing using the estimated Airlight and Transmission
- This project is licensed under the BSD 2 License - see the LICENSE.md file for details
-
The author would like to thank Gaofeng MENG, Ying WANG, Jiangyong DUAN, Shiming XIANG, Chunhong PAN for their paper "Efficient Image Dehazing with Boundary Constraint and Contextual Regularization"
-
The author would like to thank Alexandre Boucaud. The function psf2otf was obtained from his repository. (https://github.com/aboucaud/pypher/blob/master/pypher/pypher.py)
-
The Author would like to thank Dr. Suresh Merugu for his matlab implementation of the codes. This repository is the python implementation of the matlab codes.
Merugu, Suresh. (2014). Re: How to detect fog in an image and then enhance the image to remove fog?. Retrieved from: https://www.researchgate.net/post/How_to_detect_fog_in_an_image_and_then_enhance_the_image_to_remove_fog/53ae3f10d2fd64c3648b45a9/citation/download.