Giter Site home page Giter Site logo

singleimagehazeremover's Introduction

Single image haze removal

A Python2 implementation of single image haze removal

The propose of this repository is to implement the image haze removal base on the Zhiming Tan Et al. paper.

Usage

The code can be executed via terminal

python dehaze.py then input the PATH_TO_IMAGE imagename.png


Sample input

Original Image

Sample output

Clarified image w=0.95, t0=0.55


How does it work.

This dehaze algorithm contains three steps,

  1. Determine intensity of atmospheric light
  2. Estimate transmission map
  3. Clarify image

First, the intensity of atmospheric light A is estimated form hazed image I(x). Then, the transmission map t(x) is estimated using A and I(x). Finally, the image is clarified with the image defogging model.

Step#1 Estimate intensity of atmospheric light:

Find the top 0.1% brightest pixels in the dark channel then choose one with highest intensity as the representing of atmospheric light.

Step#2 Estimate transmission map:

First, find a dark channel based on a local area(coarsemap) Then, the transmission map t(x) is thereby obtained:

t(x) = 1 โ€“ defoggingParam * darkPixelFromCoarseMap / AtmosphericLightIntensity

The defoggingParam is a value between 0 to 1. The higher value the lesser amount of fog would be kept for the distant objects.

Step#3 Clarify image:

Finally, the image is clarified by: J(x)=(I(x)- A)/max(t(x), t0)+A

Where J(x) is output, I(x) is input, t(x) is transmission map, A is atmospheric light and t0 is set to a constant value to avoid dividing by zero.

singleimagehazeremover's People

Contributors

kindraywind avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

singleimagehazeremover's Issues

Dehaze.py takes forever to run

When running python dehaze.py <file_path> <image_name> it's taking forever for the code to execute. I kept it running on the terminal for 15 minutes and it didn't produce an output. Any reason why this could be happening?

Poosible to adapth this algorithm to work on huge images?

I have some large gigapixel panoramas (+/- 390Gb 16bit tiff) which need haze removal. Doing haze removal prior to stiching does not work well so haze removal has to be done after stiching. I can split the finished image in smaller pieces. Is it possible to adapt your algorithm to process all images and then do haze removal?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.