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;
没有合适的资源?快使用搜索试试~ 我知道了~
基于Matlab实现峰值信噪比 (PSNR) 和结构相似性 (SSIM)
共11个文件
m:6个
jpg:4个
bmp:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 3 下载量 28 浏览量
2022-10-23
20:29:57
上传
评论 2
收藏 376KB ZIP 举报
温馨提示
1.版本:matlab2019a,不会运行可私信博主 2.领域:【图像评价】 3.内容:基于Matlab实现峰值信噪比 (PSNR) 和结构相似性 (SSIM) 4.适合人群:本科,硕士等教研学习使用
资源推荐
资源详情
资源评论
收起资源包目录
【图像去噪】基于小波变换图像去噪(MSE和SNR)附含Matlab代码 上传.zip (11个子文件)
MSE.m 220B
运行结果4.jpg 23KB
运行结果3.jpg 40KB
sthresh.m 277B
mainbays.m 378B
bayes.m 253B
lena512.bmp 257KB
运行结果1.jpg 43KB
运行结果2.jpg 80KB
PSNR.m 444B
BaysShrink.m 2KB
共 11 条
- 1
资源评论
- 阿伟的大伟丘2024-04-29支持这个资源,内容详细,主要是能解决当下的问题,感谢大佬分享~
- m0_672595982023-06-09资源不错,很实用,内容全面,介绍详细,很好用,谢谢分享。
- guangchengsishen2023-05-19发现一个宝藏资源,资源有很高的参考价值,赶紧学起来~
天天Matlab科研工作室
- 粉丝: 3w+
- 资源: 7249
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功