This repo contains a python implementation of image dehazing as described in
- Non-Local Image Dehazing, Berman et al. CVPR 2016 [1].
- Air-light Estimation Using Haze-Lines, Berman et al. ICCP 2017 [3].
The idea behind image dehazing is to improve the visibility of images captured in hazy/foggy weather conditions. The light absorption caused by haze (dust, smoke, water droplets, etc.) reduces contrast and alters the color of objects in pictures resulting in a washed-out look.
Dehazing matters not only for outdoor photography but also for stuff like remote sensing, autonomous navigation, etc.
Most non-ML dehazing methods are based on the atmospheric scattering hazy image formation model [2]:
where
where
The model is based on the concept of haze-lines in RGB space, which are formed by haze affecting different pixels at different distances from the camera.
The idea is that colors in a haze-free image can be approximated by a few distinct clusters in RGB space which when distorted by haze, form these haze-lines. The algorithm estimates the transmission map and air-light for each pixel using the haze-lines to recover the clear image.
Each haze-line in RGB space is defined by its relationship to the air-light value
Air-light is estimated applying the method described in [3] which I outline below.
The algorithm clusters pixel's colors in the hazy image and then uses a Hough Transform in 2D color space to vote for the best air-light candidate based on how well the haze-lines (groups of pixels spread out along RGB color space lines) converge at candidate points. The point of convergence is the estimated air-light.
The estimated air-light serves as input to the dehazing algorithm image formation model. It separates the light scattered by atmospheric particles from the actual light reflected by objects, and corrects the color and intensity of each pixel based on its estimated distance from the camera and the amount of scattered light.
Official MATLAB implementation is here: https://github.com/danaberman/non-local-dehazing
- Air light estimation
- Radiometric correction experiments
- Test on different datasets (indoor, outdoor, remote sensing, etc.)
- Comparison with ML models
- Objective quality measurements (PSNR, SSIM, GMSD, ETC.)
[1] Berman, D., Treibitz, T., & Avidan, S. Non-Local Image Dehazing. IEEE Conf. CVPR 2016.
[2] Mccartney, E.J.; Hall, F.F. Optics of the Atmosphere: Scattering by Molecules and Particles. Phys. Today 1977, 30, 76–77. https://pubs.aip.org/physicstoday/article-abstract/30/5/76/431713/Optics-of-the-Atmosphere-Scattering-by-Molecules?redirectedFrom=fulltext
[3] Berman, D., Treibitz, T., & Avidan, S. Air-light Estimation Using Haze-Lines. IEEE Conf. ICCP 2017.
[4] Ancuti, C. O., Ancuti, C., Timofte, R., & Vleeschouwer, C. D. I-HAZE: a dehazing benchmark with real hazy and haze-free indoor images. ArXiv:1804.05091v1. 2018