资源简介
本程序实现全变分(Total Variation, TV)的去噪算法,它使用了PDF纠正TV算法中的小问题。该算法可以很好地保留原图边缘信息的同时,去除噪声。

代码片段和文件信息
function u = tvdenoise(flambdaNumStepsu)
%TVDENOISE Total variation image denoising
% u = TVDENOISE(flambdaNumSteps) denoises the input image f over
% NumSteps number of iterations. The larger the parameter lambda the
% stronger the denoising. The output u approximately minimizes the
% Rudin-Osher-Fatemi (ROF) denoising model
% || f - u ||^2_L^2 + lambda*TV(u)
% where TV(u) is the total variation of u.
%
% TVDENOISE(...u0) specifies the initial image u0. By default u0 = f.
%
% Example: Run TVDENOISE without any inputs for a demo
% >> tvdenoise
% Pascal Getreuer 2007
if nargin < 4
if nargin == 0
%%% Demo %%%
% Generate image
[xy] = meshgrid(linspace(-11250)linspace(-11250));
[thr] = cart2pol(xy);
f = (sqrt(2)-r).^2.*(sin(12*r + 4*th) > 0 | r < 0.05)*255;
f = conv2(fones(5)/25‘same‘);
f = f(3:5:end3:5:end);
f = f + randn(size(f))*30; % Add noise
% Denoise the image with lambda=400 and 25 iterations
v = tvdenoise(f40025);
% Plots
subplot(121);
image(f);
title(‘Noisy Image‘);
axis image; axis off; colormap(gray(256));
subplot(122);
image(v);
title(‘Denoised Image‘);
axis image; axis off; colormap(gray(256));
shg;
return;
end
u = f;
elseif any(size(f) ~= size(u))
error(‘u0 must have the same size as f.‘);
end
EpsSqr = 1e-6;
dt = 0.25;
a = dt*lambda/2;
[N1N2] = size(u);
il = [11:N2-1];
ir = [2:N2N2];
iu = [11:N1-1];
id = [2:N1N1];
for k = 1:NumSteps
ul = u(:il);
ur = u(:ir);
uu = u(iu:);
ud = u(id:);
c = a./sqrt(EpsSqr + (ur - u).^2 + (ud - u).^2);
cl = c(:il);
cu = c(iu:);
u = (u + dt*f + c.*(ur + ud) + cl.*ul + cu.*uu) ...
./ (1 + dt + 2*c + cl + cu);
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 105 2007-12-15 21:45 loadFile.do_files\50th.png
文件 96 2007-12-15 21:45 loadFile.do_files\90th.png
文件 646 2007-12-15 21:45 loadFile.do_files\blue_band_536x5.gif
文件 57 2007-12-15 21:45 loadFile.do_files\bullet.gif
文件 6880 2007-12-15 21:45 loadFile.do_files\Captcha.htm
文件 10462 2007-12-15 21:45 loadFile.do_files\cmnty1.css
文件 70 2007-12-15 21:45 loadFile.do_files\doc.gif
文件 97 2007-12-15 21:45 loadFile.do_files\dots_rnav.gif
文件 152 2007-12-15 21:45 loadFile.do_files\dots_rnav_top.gif
文件 64 2007-12-15 21:45 loadFile.do_files\exclamation.gif
文件 145 2007-12-15 21:45 loadFile.do_files\fullstar.gif
文件 117 2007-12-15 21:45 loadFile.do_files\ltblue_top_nav_trans.gif
文件 155 2007-12-15 21:45 loadFile.do_files\mail_brdr.gif
文件 2569 2007-12-15 21:45 loadFile.do_files\mlc_logo.gif
文件 11332 2007-12-15 21:45 loadFile.do_files\preview.jpg
文件 64 2007-12-15 21:45 loadFile.do_files\question.gif
文件 43 2007-12-15 21:45 loadFile.do_files\s06759144680489.gif
文件 3296 2007-12-15 21:45 loadFile.do_files\site3.css
文件 43 2007-12-15 21:45 loadFile.do_files\spacer.gif
文件 66 2007-12-15 21:45 loadFile.do_files\submitfile.gif
文件 38482 2007-12-15 21:45 loadFile.do_files\s_code.txt
文件 260 2007-12-15 21:45 loadFile.do_files\xm
目录 0 2007-12-15 21:45 loadFile.do_files
文件 2006 2007-12-15 21:39 tvdenoise.m
文件 40881 2007-12-15 21:45 loadFile.do.htm
----------- --------- ---------- ----- ----
118088 25
- 上一篇:Verilog状态机实现自动饮料售货机
- 下一篇:51旅游微信小城序源码
相关资源
- 核主成分分析方法——特征提取,去
- 新型PDE5抑制剂的设计与合成
- Probabilistic representation for solution of s
- 1种新的散乱点云快速去噪算法
- 基于小波变换的语音信号去噪及其D
- contourlet轮廓波变换去噪的算法框架介
- 基于opencv的图像去噪源代码
- 可以用VS编译的pde版本
- FPGA实现sobel图像边缘检测,VGA显示
- SideslipDemo
- 图像去噪的一些论文 硕士论文
- 非局部低秩去噪
- Evans 现代偏微分(Partical Differential
- MiniMapDemo
- 基于匹配追踪算法的时频滤波去噪方
- OkHttpDemo
- zipDecoder.zip
- SuperMap DeskPro培训教程入门和进阶
- 基于稀疏表示的图像去噪算法研究
- Image processing and analysis variational PDE
- COMSOL PDE方程应用
- 图像边缘检测,提取及轮廓跟踪源码
- BSD68 用于图像去噪算法的测试图片
- 图像亮度的自动调整
- CppOOPDesign.ccrun.857528.rar
- 全变差TV去噪(split bregman) opencv
- 经典去噪算法小波、Lee等等
- 基于深度学习的图像去噪算法研究.
- 基于稀疏表示的图像去噪算法
- 基于中值滤波和小波变换的图像去噪
评论
共有 条评论