资源简介
很好的快速导向滤波代码,可用于做边缘保持滤波和人物磨皮等,欢迎下载。
代码片段和文件信息
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 2016-01-11 11:15 fast-guided-filter-code-v1\
文件 1680646 2016-01-11 10:45 fast-guided-filter-code-v1\Fast guided filter.pdf
文件 931 2010-07-08 19:30 fast-guided-filter-code-v1\boxfilter.m
文件 759 2015-05-05 15:02 fast-guided-filter-code-v1\example_enhancement.m
文件 426 2015-05-02 22:02 fast-guided-filter-code-v1\example_feathering.m
文件 716 2015-05-02 22:01 fast-guided-filter-code-v1\example_flash.m
文件 407 2015-05-05 14:53 fast-guided-filter-code-v1\example_smoothing.m
文件 2179793 2016-01-11 10:46 fast-guided-filter-code-v1\fast-guided-filter-code-v1.rar
文件 1300 2015-05-05 15:01 fast-guided-filter-code-v1\fastguidedfilter.m
文件 3092 2015-05-05 15:01 fast-guided-filter-code-v1\fastguidedfilter_color.m
文件 957 2010-07-08 21:57 fast-guided-filter-code-v1\guidedfilter.m
文件 2462 2011-05-03 04:12 fast-guided-filter-code-v1\guidedfilter_color.m
目录 0 2016-01-11 11:15 fast-guided-filter-code-v1\img_enhancement\
文件 2880056 2010-03-05 16:09 fast-guided-filter-code-v1\img_enhancement\tulips.bmp
目录 0 2016-01-11 11:15 fast-guided-filter-code-v1\img_feathering\
文件 947480 2010-07-08 22:24 fast-guided-filter-code-v1\img_feathering\toy-mask.bmp
文件 947480 2010-07-08 22:24 fast-guided-filter-code-v1\img_feathering\toy.bmp
目录 0 2016-01-11 11:15 fast-guided-filter-code-v1\img_flash\
文件 786488 2010-02-24 13:31 fast-guided-filter-code-v1\img_flash\cave-flash.bmp
文件 786488 2010-02-24 13:30 fast-guided-filter-code-v1\img_flash\cave-noflash.bmp
目录 0 2016-01-11 11:15 fast-guided-filter-code-v1\img_smoothing\
文件 77256 2010-02-27 16:16 fast-guided-filter-code-v1\img_smoothing\cat.bmp
文件 1021 2015-05-02 22:03 fast-guided-filter-code-v1\readme.txt
- 上一篇:Intel 至强phi培训
- 下一篇:液压系统建模与仿真-李永堂.
评论
共有 条评论