1 Star 0 Fork 0

Hui Li(李辉)/imagefusion_deeplearning

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
lowpass.m 1.40 KB
一键复制 编辑 原始数据 按行查看 历史
Hui Li(李辉) 提交于 2017-12-26 14:38 . image decomposition
function [sl, sh] = lowpass(s, lambda, npad)
% lowpass -- Lowpass filter image and return low and high frequency
% components, consisting of the lowpass filtered image and
% its difference with the input image. The lowpass filter
% is equivalent to Tikhonov regularization with lambda as
% the regularization parameter and a discrete gradient as
% the operator in the regularization term.
%
% Usage:
% [sl, sh] = lowpass(s, lambda, npad)
%
% Input:
% s Input image or 3d array of images
% lambda Regularization parameter controlling lowpass filtering
% npad Number of samples to pad at image boundaries
%
% Output:
% sl Lowpass component
% sh Highpass component
%
%
% Author: Brendt Wohlberg <brendt@lanl.gov> Modified: 2015-04-09
%
% This file is part of the SPORCO library. Details of the copyright
% and user license can be found in the 'License' file distributed with
% the library.
if nargin < 3,
npad = 16;
end
grv = [-1 1];
gcv = [-1 1]';
Gr = fft2(grv, size(s,1)+2*npad, size(s,2)+2*npad);
Gc = fft2(gcv, size(s,1)+2*npad, size(s,2)+2*npad);
A = 1 + lambda*conj(Gr).*Gr + lambda*conj(Gc).*Gc;
sp = padarray(s, [npad npad], 'symmetric', 'both');
slp = ifft2(bsxfun(@rdivide, fft2(sp), A), 'symmetric');
sl = slp((npad+1):(size(slp,1)-npad), (npad+1):(size(slp,2)-npad), :);
sh = s - sl;
return
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Matlab
1
https://gitee.com/hli1221/imagefusion_deeplearning.git
git@gitee.com:hli1221/imagefusion_deeplearning.git
hli1221
imagefusion_deeplearning
imagefusion_deeplearning
master

搜索帮助