This project was implemented as part of CS 663: Fundamentals of Digital Image Processing at IIT Bombay during Autumn 2021 under Prof. Ajit Rajwade. The goal is to remove haze from outdoor images using the Dark Channel Prior technique.
Haze removal or image dehazing is a technique to improve the visibility of outdoor images by estimating the scene transmission and recovering the radiance of the image. This project implements:
- Dark Channel Prior for estimating haze-free images.
- With/Without Guided Filtering to reduce artifacts and improve edge preservation.
-
With_soft_matting.m
MATLAB script to perform haze removal with soft matting (Guided Filter). -
Without_soft_matting.m
MATLAB script to perform haze removal without soft matting. -
Haze_Removal.pdf
Detailed project report explaining the algorithm, equations, and results. -
Datasets/Our_dataset/
Contains input hazy images used for testing. -
Results/
Outputs of the dehazed images with and without the Guided Filter.
The key steps of the haze removal process are as follows:
-
Dark Channel Prior Estimation:
The dark channel is calculated by finding the minimum pixel values in RGB channels over patches. -
Atmospheric Light Estimation:
Identifies the brightest pixels in the dark channel to estimate the global atmospheric light ( A ). -
Transmission Map Estimation:
Transmission ( t(x) ) is estimated based on the dark channel prior. -
Guided Filtering (optional):
Used to refine the transmission map and reduce artifacts. -
Scene Radiance Recovery:
The final dehazed image is recovered using the estimated transmission and atmospheric light.
Artifacts like halo effects and block artifacts appear because the transmission map assumes constant transmission over patches.
Hazy Image | Dark Channel | Dehazed Image |
---|---|---|
![]() |
![]() |
![]() |
Guided Filter improves results by refining the transmission map and preserving edges.
Hazy Image | Dehazed Image | RMSE Value |
---|---|---|
![]() |
![]() |
0.198 |
![]() |
![]() |
0.000 |
![]() |
![]() |
0.244 |
- Without Guided Filter, halo and block artifacts are prominent.
- Using Guided Filter, artifacts are removed due to edge-preserving properties.
- Edge preservation is beyond the project's scope but significantly improves results.
- Install MATLAB and ensure the
Image Processing Toolbox
is available. - Clone this repository:
git clone https://github.com/TheShiningVampire/Haze_Removal_CS663_Project.git cd Haze_Removal_CS663_Project
- Run the scripts:
- For haze removal without guided filtering:
Without_soft_matting
- For haze removal with guided filtering:
With_soft_matting
- For haze removal without guided filtering:
- Output images will be saved in the
Results
folder.
- K. He, J. Sun, and X. Tang, "Single Image Haze Removal Using Dark Channel Prior", CVPR 2009.