【图像去噪】基于自适应小波阙值算法实现图像去噪附matlab代码
【图像去噪】基于自适应小波阙值算法实现图像去噪附matlab代码
TT_Matlab
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,完整matlab代码或者程序定制加qq1575304183。
1 内容介绍
基于 Donoho经典小波阈值去除图像噪声基本思路,分析常用硬阈值法和软阈值法在图像去噪中的缺陷。针对这些缺陷,提出一种改进的阈值去噪法,该方法不仅可克服硬阈值不连续的缺点,还能够有效解决小波分解预估计系数与真实小波系数间存有的恒定误差。通过 Matlab仿真实验,使用改进的小波阈值法对图像去噪处理后,除 噪效果比较理想,在去噪性能指标上,PSNR(峰值信噪比)和 EPI(边缘保护指数)均好于传统阈值方法。
采集、编码或者传输图像时,图像容易遭受噪声污染,因此图像去噪尤为重要。随着对小波理论研究的深入,其应用也日趋广泛,利用小波变换进行图像去噪成为研究热点。目前,小波图像去噪 基 本 方 法 有:①利用小波变换模极大值方法进行图像去噪;②利用小波变换尺度相关性方法进行图像去 噪;③利用小波阈值去噪法进行图像去噪。上述3种基 本 方 法 中,小波阈值去噪法相对于小波模极大值法与小波变换尺度相关性法,其 运 算 量 小,实现简单且使用广泛。小波阈值去噪法也有其不足:在小波硬阈值去噪处理过程中,获取的小波系 数 预 估 计 连 续 性 差,会 造 成 重 构 信号波动,而软阈值法算出的估计小波系数虽然连续性较好,但其与真实小波系数有恒定偏差,造成重构信号精度变低,导致图像模糊。本文结合经典硬阈值和软阈值法各自的优缺点,提出一种改进的小波阈值图像去噪算法。
2 仿真代码
function output = BaysShrink(x,wv,L)
%
IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 9, NO. 9, SEPTEMBER 2000
%
Adaptive Wavelet Thresholding
for
Image Denoising and Compression
%
S. Grace Chang, Student Member, IEEE, Bin Yu, Senior Member, IEEE, and
%
Martin Vetterli, Fellow, IEEE
%
----------------------------------------------liujiabin 2010.5.12
%
input:
%
x: 2-D signal matrix m by n
%
wv: filtertype, the
type
of wavelet(filterbank) used
%
L: number of levels
%
output:
%
output: 2-D signal matrix m by n.
%
%
noise = randn(size(f));
%
noise = noise/sqrt(mean2(noise.^2));
%
%
% add Gaussian noise
%
g = double(f)+ sigma*noise;
%
bayes soft thresholding
%
the level of decomposition
%
%%%%%%%%%%%%%%%%%%%%
%
Denoising using Bayes soft thresholding
%
Note: Figure window 1 displays the original image, fig 2 the noisy img
%
Define the
type
of wavelet(filterbank) used and the number of scales
in
the wavelet decomp
%
Doing the wavelet decomposition
[C,S]=wavedec2(x,L,wv);
st=(S(1,1)^2)+1;
bayesC=[C(1:st-1),zeros(1,length(st:1:length(C)))];
var=length(C)-S(size(S,1)-1,1)^2+1;
%
Calculating sigmahat
sigmahat=median(abs(C(var:length(C))))/0.6745;
for jj=2:size(S,1)-1
%for the H detail coefficients
coefh=C(st:st+S(jj,1)^2-1);
thr=bayes(coefh,sigmahat);
bayesC(st:st+S(jj,1)^2-1)=sthresh(coefh,thr);
st=st+S(jj,1)^2;
% for the V detail coefficients
coefv=C(st:st+S(jj,1)^2-1);
thr=bayes(coefv,sigmahat);
bayesC(st:st+S(jj,1)^2-1)=sthresh(coefv,thr);
st=st+S(jj,1)^2;
%for Diag detail coefficients
coefd=C(st:st+S(jj,1)^2-1);
thr=bayes(coefd,sigmahat);
bayesC(st:st+S(jj,1)^2-1)=sthresh(coefd,thr);
st=st+S(jj,1)^2;
end
%
Reconstructing the image from the Bayes-thresholded wavelet coefficients
bayespic=waverec2(bayesC,S,wv);
output = bayespic;
3 运行结果
4 参考文献
[1] F. Abramovich, T. Sapatinas, and B. W. Silverman, “Wavelet thresh olding via a Bayesian approach,” J. R. Statist. Soc. , ser. B, vol. 60, pp. 725–749, 1998.
[2] M. Antonini, M. Barlaud, P. Mathieu, and I. Daubechies, “Image coding using wavelet transform,” IEEE Trans. Image Processing , vol. 1, no. 2, pp. 205–220, 1992.
[3] J. Buckheit, S. Chen, D. Donoho, I. Johnstone, and J. Scargle, “WaveLab Toolkit,”, http://www-stat.stanford.edu:80/~wavelab/. [4] A. Chambolle, R. A. DeVore, N. Lee, and B. J. Lucier, “Nonlinear
wavelet image processing: Variational problems, compression, and noise removal through wavelet shrinkage,” IEEE Trans. Image Pro cessing , vol. 7, pp. 319–335, 1998.
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。
-
2023年血糖新标准公布,不是3.9-6.1,快来看看你的血糖正常吗? 2023-02-07
-
2023年各省最新电价一览!8省中午执行谷段电价! 2023-01-03
-
GB 55009-2021《燃气工程项目规范》(含条文说明),2022年1月1日起实施 2021-11-07
-
PPT导出高分辨率图片的四种方法 2022-09-22
-
2023年最新!国家电网27家省级电力公司负责人大盘点 2023-03-14
-
全国消防救援总队主官及简历(2023.2) 2023-02-10
-
盘点 l 中国石油大庆油田现任领导班子 2023-02-28
-
我们的前辈!历届全国工程勘察设计大师完整名单! 2022-11-18
-
关于某送变电公司“4·22”人身死亡事故的快报 2022-04-26
