<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">
<html xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--
This HTML is auto-generated from an M-file.
To make changes, update the M-file and republish this document.
-->
<title>Image Denoising with Wavelets</title>
<meta name="generator" content="MATLAB 7.4">
<meta name="date" content="2008-10-15">
<meta name="m-file" content="index">
<LINK REL="stylesheet" HREF="style.css" TYPE="text/css">
</head>
<body>
<div class="content">
<h1>Image Denoising with Wavelets</h1>
<introduction>
<p>This numerical tour uses wavelets to perform both linear and non-linear image denoising.</p>
</introduction>
<h2>Contents</h2>
<div>
<ul>
<li><a href="#1">Installing toolboxes and setting up the path.</a></li>
<li><a href="#8">Thresholding Estimator and Sparsity</a></li>
<li><a href="#14">Image loading and adding Gaussian noise.</a></li>
<li><a href="#17">Hard Thresholding vs. Soft Thresholding</a></li>
<li><a href="#19">Orthogonal Wavelet Denoising</a></li>
<li><a href="#26">Estimating the noise level</a></li>
<li><a href="#29">Translation Invariant Wavelet Transform</a></li>
<li><a href="#33">Translation Invariant Wavelet Denoising</a></li>
<li><a href="#39">Wavelet Block Thresholding</a></li>
</ul>
</div>
<h2>Installing toolboxes and setting up the path.<a name="1"></a></h2>
<p>You need to download the <a href="../toolbox_general.zip">general purpose toolbox</a> and the <a href="../toolbox_signal.zip">signal toolbox</a>.
</p>
<p>You need to unzip these toolboxes in your working directory, so that you have <tt>toolbox_general/</tt> and <tt>toolbox_signal/</tt> in your directory.
</p>
<p><b>For Scilab user:</b> you must replace the Matlab comment '%' by its Scilab counterpart '//'.
</p>
<p><b>Recommandation:</b> You should create a text file named for instance <tt>numericaltour.sce</tt> (in Scilabe) or <tt>numericaltour.m</tt> to write all the Scilab/Matlab command you want to execute. Then, simply run <tt>exec('numericaltour.sce');</tt> (in Scilab) or <tt>numericaltour;</tt> (in Matlab) to run the commands.
</p>
<p>Execute this line only if you are using Matlab.</p><pre class="codeinput">getd = @(p)path(path,p); <span class="comment">% scilab users must *not* execute this</span>
</pre><p>Then you can add these toolboxes to the path.</p><pre class="codeinput"><span class="comment">% Add some directories to the path</span>
getd(<span class="string">'toolbox_signal/'</span>);
getd(<span class="string">'toolbox_general/'</span>);
</pre><h2>Thresholding Estimator and Sparsity<a name="8"></a></h2>
<p>The idea of non-linear denoising is to use an orthogonal basis in which the coefficients <tt>x</tt> of the signal or image <tt>M0</tt> is sparse (a few large coefficients). In this case, the noisy coefficients <tt>x</tt> of the noisy data <tt>M</tt> (perturbated with Gaussian noise) are <tt>x0+noise</tt> where <tt>noise</tt> is Gaussian. A thresholding set to 0 the noise coefficients that are below <tt>T</tt>. The threshold level <tt>T</tt> should be chosen judiciously to be just above the noise level.
</p>
<p>First we generate a spiky signal.</p><pre class="codeinput"><span class="comment">% dimension</span>
n = 4096;
<span class="comment">% probability of spiking</span>
rho = .05;
<span class="comment">% location of the spike</span>
x0 = rand(n,1)<rho;
<span class="comment">% random amplitude in [-1 1]</span>
x0 = 2 * x0 .* ( rand(n,1)-.5 );
</pre><p>We add some gaussian noise</p><pre class="codeinput">sigma = .1;
x = x0 + randn(size(x0))*sigma;
<span class="comment">% display</span>
clf;
subplot(2,1,1);
plot(x0); axis([1 n -1 1]);
set_graphic_sizes([], 20);
title(<span class="string">'Original signal'</span>);
subplot(2,1,2);
plot(x); axis([1 n -1 1]);
set_graphic_sizes([], 20);
title(<span class="string">'Noisy signal'</span>);
</pre><img vspace="5" hspace="5" src="index_01.png"> <p><i>Exercice 1:</i> (the solution is <a href="../private/denoising_wavelet/exo1.m">exo1.m</a>) What is the optimal threshold <tt>T</tt> to remove as much as possible of noise ? Try several values of <tt>T</tt>.
</p><pre class="codeinput">exo1;
</pre><img vspace="5" hspace="5" src="index_02.png"> <p>In order to be optimal without knowing in advance the amplitude of the coefficients of <tt>x0</tt>, one needs to set <tt>T</tt> just above the noise level. This means that <tt>T</tt> should be roughly equal to the maximum value of a Gaussian white noise of size <tt>n</tt>.
</p>
<p><i>Exercice 2:</i> (the solution is <a href="../private/denoising_wavelet/exo2.m">exo2.m</a>) The theory predicts that the maximum of <tt>n</tt> Gaussian variable of variance <tt>sigma^2</tt> is smaller than <tt>sqrt(2*log(n))</tt> with large probability (that tends to 1 when <tt>n</tt> increases). This is also a sharp result. Check this numerically by computing with Monte Carlo sampling the maximum with <tt>n</tt> increasing (in power of 2). Check also the deviation of the maximum when you perform several trial with <tt>n</tt> fixed.
</p><pre class="codeinput">exo2;
</pre><img vspace="5" hspace="5" src="index_03.png"> <h2>Image loading and adding Gaussian noise.<a name="14"></a></h2>
<p>A simple noise model is additive Gaussian noise.</p>
<p>First we load an image.</p><pre class="codeinput">name = <span class="string">'boat'</span>;
n = 256;
M0 = load_image(name,n);
M0 = rescale( M0, .05, .95 );
</pre><p>Then we add some gaussian noise to it.</p><pre class="codeinput">sigma = .08; <span class="comment">% noise level</span>
M = M0 + sigma*randn(size(M0));
clf;
imageplot(M0, <span class="string">'Original'</span>, 1,2,1);
imageplot(clamp(M), <span class="string">'Noisy'</span>, 1,2,2);
</pre><img vspace="5" hspace="5" src="index_04.png"> <h2>Hard Thresholding vs. Soft Thresholding<a name="17"></a></h2>
<p>A thresholding is a 1D non-linear function applied to each wavelet coefficients. The most important thresholding are the hard
thresholding (related to L0 minimization) and the soft thresholding (related to L1 minimization).
</p><pre class="codeinput"><span class="comment">% threshold value</span>
T = 1;
v = -linspace(-3,3,2000);
<span class="comment">% hard thresholding of the t values</span>
v_hard = v.*(abs(v)>T);
<span class="comment">% soft thresholding of the t values</span>
v_soft = max(1-T./abs(v), 0).*v;
<span class="comment">% display</span>
clf;
hold(<span class="string">'on'</span>);
plot(v, v_hard);
plot(v, v_soft, <span class="string">'r--'</span>);
axis(<span class="string">'equal'</span>); axis(<span class="string">'tight'</span>);
legend(<span class="string">'Hard thresholding'</span>, <span class="string">'Soft thresholding'</span>);
hold(<span class="string">'off'</span>);
</pre><img vspace="5" hspace="5" src="index_05.png"> <h2>Orthogonal Wavelet Denoising<a name="19"></a></h2>
<p>It is possible to perform non linear denoising by thresholding the wavelet coefficients. This allows to better respect the
sharp features of the image.
</p>
<p>First we compute the wavelet coefficients of the noisy image.</p><pre class="codeinput">options.ti = 0;
Jmin = 4;
MW = perform_wavelet_transf(M,Jmin,+1,options);
</pre><p>Then we hard threshold the coefficients below the noise level. In practice a threshold of <tt>3*sigma</tt> is close to optimal for natural images.
</p><pre class="codeinput">T = 3*sigma;
MWT = perform_thres
没有合适的资源?快使用搜索试试~ 我知道了~
小波去噪 MATLAB
共242个文件
png:190个
css:24个
html:23个
5星 · 超过95%的资源 需积分: 10 165 下载量 124 浏览量
2009-05-05
16:57:10
上传
评论 1
收藏 11.76MB RAR 举报
温馨提示
利用小波分解对含噪声图像进行阈值去噪,重构得到新图像。将图像分解后的高频部分的振幅进行软阈值去噪 ,并将试验结果与实数小波去噪结果相比较。结果表明该方法既能有效地去除噪声 ,又能保持图像的大量原始信息
资源推荐
资源详情
资源评论
收起资源包目录
小波去噪 MATLAB (242个子文件)
wavtourstyle.css 5KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
style.css 1KB
._wavtourstyle.css 178B
index.html 28KB
index.html 23KB
index.html 23KB
index.html 22KB
index.html 20KB
index.html 19KB
index.html 18KB
index.html 18KB
index.html 17KB
index.html 15KB
index.html 14KB
index.html 14KB
index.html 13KB
index.html 13KB
index.html 12KB
index.html 12KB
index.html 11KB
index.html 10KB
index.html 10KB
index.html 9KB
index.html 8KB
index.html 7KB
._index.html 188B
cover.jpg 13KB
._cover.jpg 201B
index_03.png 158KB
index_02.png 157KB
index_02.png 147KB
index_06.png 146KB
index_03.png 129KB
index_04.png 126KB
index_05.png 120KB
index_05.png 119KB
index_04.png 119KB
index_03.png 115KB
index_01.png 115KB
index_07.png 114KB
index_10.png 114KB
index_04.png 112KB
index_08.png 105KB
index_06.png 104KB
index_04.png 103KB
index_08.png 99KB
index_05.png 99KB
index_01.png 97KB
index_02.png 97KB
index_03.png 97KB
index_04.png 96KB
index_06.png 95KB
index_02.png 95KB
index_11.png 88KB
index_10.png 88KB
index_08.png 87KB
index_03.png 86KB
index_16.png 85KB
index_08.png 84KB
index_04.png 83KB
index_02.png 81KB
index_06.png 80KB
index_13.png 79KB
index_03.png 79KB
index_03.png 75KB
index_18.png 74KB
index_04.png 72KB
index_05.png 72KB
index_02.png 70KB
index_03.png 68KB
index_15.png 67KB
index_01.png 66KB
index_06.png 64KB
index_04.png 64KB
index_07.png 58KB
index_01.png 58KB
index_02.png 58KB
index_01.png 57KB
index_04.png 57KB
共 242 条
- 1
- 2
- 3
hp_ysy
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页