总变分去噪工具箱
来源:互联网 发布:军中妖姬汤灿 知乎 编辑:程序博客网 时间:2024/04/28 22:17
Optimization codes for sparsity related signal processing
Total Variation Denoising
Test for Rudin-Osher-Fatemi denoising (ROF) using FB-like method.
addpath('../');addpath('../toolbox/');
Load image.
n = 256;y = load_image('lena',n*2);y = rescale(crop(y,n));y = y + randn(n)*.06;
Display it.
clf;imageplot(clamp(y));
We aim at minimising:
min_x 1/2*norm(y-x,'fro')^2 + lambda*norm(K(x),1)
Regularization parameter.
lambda = .2;
where K is a vectorial gradient and norm(u,1) is a vectorial L1 norme.
K = @(x)grad(x);KS = @(x)-div(x);
It can be put as the minimization of F(K*x) + G(x)
Amplitude = @(u)sqrt(sum(u.^2,3));F = @(u)lambda*sum(sum(Amplitude(u)));G = @(x)1/2*norm(y-x,'fro')^2;
The proximity operator of F is the vectorial soft thresholding.
Normalize = @(u)u./repmat( max(Amplitude(u),1e-10), [1 1 2] );ProxF = @(u,tau)repmat( perform_soft_thresholding(Amplitude(u),lambda*tau), [1 1 2]).*Normalize(u);ProxFS = compute_dual_prox(ProxF);
The proximity operator of G.
ProxG = @(x,tau)(x+tau*y)/(1+tau);
Function to record progression of the functional.
options.report = @(x)G(x) + F(K(x));
Run the ADMM algorihtm.
options.niter = 300;[xAdmm,EAdmm] = perform_admm(y, K, KS, ProxFS, ProxG, options);
[********************]
Display image.
clf;imageplot(xAdmm);
Since the functional to mimize is stricly convex, we can use a FB scheme on the dual problem.
GradGS = @(x)x+y;L = 8;options.method = 'fista';[xFista,EFista] = perform_fb_strongly(y, K, KS, GradGS, ProxFS, L, options);
[********************]
Compare the energy decays.
clf;plot([EAdmm(:) EFista(:)]);axis tight;legend('ADMM', 'FISTA');axis([1 length(EAdmm) EFista(end)*.9 2000]);
Contact us at files@mathworks.com
来源: http://www.mathworks.com/matlabcentral/fileexchange/16204-toolbox-sparse-optmization/content/toolbox_optim/tests/html/test_tv_lagrangian.html
- 总变分去噪工具箱
- 工具箱
- 工具箱
- 工具箱
- 工具箱
- 工具箱
- 工具箱
- Windows/支持工具箱/资源工具箱/调试工具箱
- 技术工具箱
- 工具箱代码
- Matlab 工具箱
- 站长工具箱
- 马尔可夫工具箱
- levelset工具箱
- 【数学题】工具箱
- Xtools工具箱
- 自用工具箱
- Toolboxes--工具箱
- python 调用shell命令三种方法
- 最大子序列、最长公共子串、最长公共子序列
- 路网中的问题汇总
- 创建字符设备的三种方法
- ADC与MAS
- 总变分去噪工具箱
- c++ 虚函数的实现机制:笔记
- 不用鼠标玩电脑
- 网卡指示灯含义及故障分析
- 游戏人生-dota杂想
- POSA2:Wrapper Facade模式
- Udev学习总结
- C和C++混合编译
- 辅导“职称计算机应用能力考试”中的一次收获