Coder Social home page Coder Social logo

utkarsh-deshmukh / single-image-dehazing-python Goto Github PK

View Code? Open in Web Editor NEW
95.0 3.0 24.0 7.7 MB

python implementation of the paper: "Efficient Image Dehazing with Boundary Constraint and Contextual Regularization"

License: BSD 2-Clause "Simplified" License

Python 100.00%
computer-vision image-dehazing python opencv haze-removal haze-removal-algorithm defogging fog-removal single-image-dehazing single-image-defogging

single-image-dehazing-python's Introduction

Hi there ๐Ÿ‘‹, I am Utkarsh. A computer vision enthusiast.

On my Github page, I try my best to keep all my projects as an end2end runnable modules. What that means is I want to make these modules as hassle-free and easily runnable as possible.

About me:

๐Ÿ”ญ Iโ€™m currently working as a Computer Vision Developer at Rivian Automotives.

๐Ÿ“ซ How to reach me: utkarsh-linkedin

Utkarsh's GitHub stats Top Langs

Languages and Tools:

python opencv cplusplus pytorch scikit_learn matlab git c arduino flask

single-image-dehazing-python's People

Contributors

utkarsh-deshmukh 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  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  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

single-image-dehazing-python's Issues

Not working with pip install

Hello brother shared code example is not working with pip install

The following error

File "/home/mrtan/ritvik/image_dehazer.py", line 15, in
HazeCorrectedImg, HazeMap = image_dehazer.remove_haze(HazeImg) # Remove Haze
AttributeError: partially initialized module 'image_dehazer' has no attribute 'remove_haze' (most likely due to a circular import)

Does not work with Python2.7

  Downloading image_dehazer-0.0.4.tar.gz (5.0 kB)

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
DEPRECATION: The -b/--build/--build-dir/--build-directory option is deprecated and has no effect anymore. pip 21.1 will remove support for this functionality. A possible replacement is use the TMPDIR/TEMP/TMP environment variable, possibly combined with --no-clean. You can find discussion regarding this at https://github.com/pypa/pip/issues/8333.
ERROR: Could not find a version that satisfies the requirement numpy==1.19.0 (from image-dehazer) (from versions: 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0.post2, 1.10.1, 1.10.2, 1.10.4, 1.11.0b3, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.11.1rc1, 1.11.1, 1.11.2rc1, 1.11.2, 1.11.3, 1.12.0b1, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.12.1rc1, 1.12.1, 1.13.0rc1, 1.13.0rc2, 1.13.0, 1.13.1, 1.13.3, 1.14.0rc1, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.14.5, 1.14.6, 1.15.0rc1, 1.15.0rc2, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0rc1, 1.16.0rc2, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.16.6)
ERROR: No matching distribution found for numpy==1.19.0 (from image-dehazer)

Real time

Can This algorithm works with a real time video?

difference in calling dehazing using pip package

In the readme it show the implementation of the dehazing as follows

$ import image_dehazer										# Load the library

$ HazeImg = cv2.imread('image_path', 0)						# read input image
$ HazeCorrectedImg = image_dehazer.remove_haze(HazeImg)	

That means we are loading the image as grayscale and simply passing that image in remove_haze function.

But in example.py we are doing the following

HazeImg = cv2.imread('../Images/foggy_bench.jpg')
# Resize image
'''
Channels = cv2.split(HazeImg)
rows, cols = Channels[0].shape
HazeImg = cv2.resize(HazeImg, (int(0.4 * cols), int(0.4 * rows)))
'''
# Estimate Airlight
windowSze = 15
AirlightMethod = 'fast'
A = Airlight(HazeImg, AirlightMethod, windowSze)
# Calculate Boundary Constraints
windowSze = 3
C0 = 20 # Default value = 20 (as recommended in the paper)
C1 = 300 # Default value = 300 (as recommended in the paper)
Transmission = BoundCon(HazeImg, A, C0, C1, windowSze) # Computing the Transmission using equation (7) in the paper
# Refine estimate of transmission
regularize_lambda = 1 # Default value = 1 (as recommended in the paper) --> Regularization parameter, the more this value, the closer to the original patch wise transmission
sigma = 0.5
Transmission = CalTransmission(HazeImg, Transmission, regularize_lambda, sigma) # Using contextual information
# Perform DeHazing
HazeCorrectedImg = removeHaze(HazeImg, Transmission, A, 0.85)

That is we are using the color image and calculating Transmission Airlight and then passing those values to removeHaze(HazeImg, Transmission, A, 0.85)

Is the pip documentation wrong/outdated? or image_dehazer.remove_haze(HazeImg) function calculates them internally? If so why we are using grayscale image?

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.