Giter VIP home page Giter VIP logo

dark-channel-haze-removal's People

Contributors

sjtrny 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dark-channel-haze-removal's Issues

clarification on formula

@sjtrny

Hi Stephen, very nice code. I am trying to reproduce this method in R. I have a small question I came across while porting: in get_atmosphere.m

n_search_pixels = floor(n_pixels * 0.01);

In the reference paper (http://research.microsoft.com/en-us/um/people/jiansun/papers/Dehaze_CVPR2009.pdf) it is stated

0.1% bright-est pixels in the dark channel. These pixels are most haze-opaque (bounded by yellow lines in Figure6(b)).

It doesn't make much difference (I would say) at the end since you take the average of the accumulated pixels, but I was wondering why you used 1% instead of 0.1%.

Many thanks in advance.

Issue of the get_atmoshperic.m

In your get_atmoshpere.m code, you first select top 1% percent brightest pixels in the dark channel. Then, the average intensity of these pixels in the original input hazy images is regarded as the atmospheric light. However, this does not match the original paper (Single Image Haze Removal Using Dark Channel Prior) that illustrates the atmospheric light is considered as the pixels with highest intensity (mean intensity of each channel) in the input hazy image I are selected the atmosphere light.

Therefore, I provide my revised code based on your given code.
function atmosphere = get_atmosphere(image, dark_channel)

[m, n, ~] = size(image);
n_pixels = m * n;

n_search_pixels = floor(n_pixels * 0.001);

dark_vec = reshape(dark_channel, n_pixels, 1);

image_vec = reshape(image, n_pixels, 3);

[~, indices] = sort(dark_vec, 'descend');

% accumulator = zeros(1, 3);

% for k = 1 : n_search_pixels
% accumulator = accumulator + image_vec(indices(k),:);
% end
%
% atmosphere = accumulator / n_search_pixels;

atmosphere_search_pixels = zeros(n_search_pixels,3);
for k=1 : n_search_pixels
atmosphere_search_pixels(k,:) = image_vec(indices(k),:);
end

[~, top_intensity_indices] = sort(mean(atmosphere_search_pixels,2), 'descend');
atmosphere = atmosphere_search_pixels(top_intensity_indices(1),:);

end

empty matrix in get_laplacian.m

Hi @sjtrny
I was looking into get Laplacian and I was testing it with a very simple image (resize of the original forest image to 10% of the original size). I see that the win_inds array becomes:

Empty matrix: 1-by-0

since n_min becomes bigger than n_max.

(When k is around 8010 just to give you a reference.)
The emptiness of the matrix has problems that hit then num_neigh that becomes 0 and win_var becomes NaN.
Is this behavior on purpose? I quite don't get it. Can you, please, give me some details on this? Since of course R, to which I am porting the code and idea, complains much more than matlab already when the indexes of the win_inds don't match anymore the dimensions.

Many thanks in advance.

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.