-
大小: 1KB文件类型: .rar金币: 1下载: 0 次发布日期: 2021-05-07
- 语言: 其他
- 标签: guidedfilter boxfilter
资源简介
基于引导滤波的图像分层处理技术,对不同层的信息进行分层处理,获取不同的信息,然后用合并,得到最后结果,可进行图像增强算法的分层等
代码片段和文件信息
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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 931 2019-08-02 15:59 boxfilter.m
文件 1086 2019-08-02 15:59 guidedfilter.m
----------- --------- ---------- ----- ----
2017 2
评论
共有 条评论