资源简介

何恺明等人研究出的基于暗通道的经典图像去雾算法,不仅可以还原图像的颜色和能见度,同时也能利用雾的浓度来估计物体的距离。 (The classic fog removal algorithm based on dark channel, which was developed by He Kaiming and others, not only can restore the color and visibility of images, but also can estimate the distance of objects by using the concentration of fog.)

资源截图

代码片段和文件信息

function imDst = boxfilter(imSrc r)

%   BOXFILTER   O(1) time box filtering using cumulative sum
%
%   - Definition imDst(x y)=sum(sum(imSrc(x-r:x+ry-r:y+r)));
%   - Running time independent of r; 
%   - Equivalent to the function: colfilt(imSrc [2*r+1 2*r+1] ‘sliding‘ @sum);
%   - But much faster.

[hei wid] = size(imSrc);
imDst = zeros(size(imSrc));

%cumulative sum over Y axis
imCum = cumsum(imSrc 1);
%difference over Y axis
imDst(1:r+1 :) = imCum(1+r:2*r+1 :);
imDst(r+2:hei-r :) = imCum(2*r+2:hei :) - imCum(1:hei-2*r-1 :);
imDst(hei-r+1:hei :) = repmat(imCum(hei :) [r 1]) - imCum(hei-2*r:hei-r-1 :);

%cumulative sum over X axis
imCum = cumsum(imDst 2);
%difference over Y axis
imDst(: 1:r+1) = imCum(: 1+r:2*r+1);
imDst(: r+2:wid-r) = imCum(: 2*r+2:wid) - imCum(: 1:wid-2*r-1);
imDst(: wid-r+1:wid) = repmat(imCum(: wid) [1 r]) - imCum(: wid-2*r:wid-r-1);
end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-10-10 16:29  Image fogging\
     文件         927  2017-09-19 20:35  Image fogging\boxfilter.m
     文件        1027  2017-09-19 20:34  Image fogging\guidedfilter.m
     文件        2440  2017-09-19 20:34  Image fogging\guidedfilter_color.m
     文件        1680  2017-09-19 20:43  Image fogging\main.m
     文件        1845  2017-09-19 20:35  Image fogging\maxfilt2.m
     文件        1845  2017-09-19 20:36  Image fogging\minfilt2.m
     文件        1529  2017-09-19 20:54  Image fogging\test_save.m
     文件        4811  2017-09-19 20:42  Image fogging\vanherk.m

评论

共有 条评论