Skip to content

Lucas-Dunker/Image-Dehazing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Overview

Project Description

This Python3 project is an implementation of He et al.'s "Single Image Haze Removal Using Dark Channel Prior". Using the paper's titular dark channel prior, this program estimates a transmission map for a provided image, refines it using soft matting, recovers scene radiance using the refined transmission, and computes a depth map of the newly de-hazed image. Intermediary steps, as well as the input and output images, are displayed on the screen as a grid. The technical background and intuition for this implentation is described in-depth in the project report.

Because it was said stated in the assignment description not to submit data, images, or videos directly to Gradescope, I would recommend using images from the Dense-Haze Kaggle dataset (linked in report) or an Adobe Stock photo for testing. If you'd like me to provide some of the images I've used in the report, I'd be happy to provide them over email.

Project Setup

This assignment was written in Windows 11 with VScode, but setup steps should be agnostic between OS's and IDE's.

  • Ensure that Python3 is installed. Python 3.11.9 was used for this project, but any non-breaking major Python3 version should work.
  • Ensure that cv2, numpy, and pymatting are installed via pip. sys should be provided with the default Python3 installation.
  • Run dehaze.py from your local terminal with a single argument containing the file location you wish to dehaze. An example from the terminal would be:
pyhon dehaze.py images/exampleImage.jpg
  • If an image path is not provided, the program will default to the image path of "./images/default.png".
  • Along with the relevant input + output + transmission maps + depth maps appearing on screen as a grid, the de-hazed output image data will be written to "./images/[IMAGE_NAME]_dehazed.jpg". Additional code can be uncommented in main() to write the other image components to disk as well. Press any key to close the cv2 graph popup and end the program. Due to the inherent processing times times in solving a linear system with PCG, expect for the full pipeline to take up to 1-2 minutes to run for images up to 1920 x 1080.

About

An implementation of He et al.'s "Single Image Haze Removal Using Dark Channel Prior"

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages