clc
clear all
close all
x1=imread('lena.bmp');%读入图像的值为无符号型unit8(),进行矩阵操作前必须先转换为矩阵运算所支持的double()双精度型。
figure(1);
subplot(2,3,1)
imshow(x1);
title('原图');
%添加高斯噪声
x2=imnoise(x1,'gaussian',0.01);
x1=double(x1);
subplot(2,3,2);
imshow(x2);
title('加噪后');
x3=double(x2);
%加噪后的信噪比
SNR=10*log(sum(x1.^2)/(sum((x3-x1).^2)))
[h0,h1]=wave1(x3);
%一次分解
[h00,h01]=wave1(h0');
[h10,h11]=wave1(h1');
% %% 中值滤波
% x0=rgb2gray(x1); %灰度处理,灰度处理后的图像是二维矩阵
n=3; %模板大小
[height, width]=size(x1); %获取图像的尺寸(n小于图片的宽高)
x11=double(x2); %数据类型转换
x22=x11; %转换后的数据赋给x2
for i=1:height-n+1
for j=1:width-n+1
c=x11(i:i+(n-1),j:j+(n-1)); %在x1中从头取模板大小的块赋给c
e=c(1,:); %e中存放是c矩阵的第一行
for u=2:n %将c中的其他行元素取出来接在e后使e为一个行矩阵
e=[e,c(u,:)];
end
med=median(e); %取一行的中值
x22(i+(n-1)/2,j+(n-1)/2)=med; %将模板各元素的中值赋给模板中心位置的元素
end
end
d=uint8(x22); %未被赋值的元素取原值
subplot(2,3,3);; imshow(d); title('中值滤波')%显示过滤后的灰度图片
% %硬阈值去噪
[t]=Throld(h11);
% [Sh00]=Soft(h00,t);
[hh01]=Soft(h01,t);
[hh10]=Soft(h10,t);
[hh11]=Soft(h11,t);
%图像重构
[H1]=revers1(h00,hh01);
[H2]=revers1(hh10,hh11);
[H3]=revers1(H1',H2');
%软阈值去噪后的信噪比
SNRH=10*log(sum(x1.^2)/(sum((H3-x1).^2)))
SS1=uint8(H3);
subplot(2,3,4)
imshow(SS1);
title('硬阈值去噪');
% %软阈值去噪
% [Sh00]=Soft(h00,t);
[Sh01]=Soft(h01,t);
[Sh10]=Soft(h10,t);
[Sh11]=Soft(h11,t);
%图像重构
[S1]=revers1(h00,Sh01);
[S2]=revers1(Sh10,Sh11);
[S3]=revers1(S1',S2');
%软阈值去噪后的信噪比
SNRS=10*log(sum(x1.^2)/(sum((S3-x1).^2)))
y2=uint8(S3);
subplot(2,3,5)
imshow(y2);
title('软阈值去噪');
没有合适的资源?快使用搜索试试~ 我知道了~
【图像去噪】基于matalb小波滤波(硬阙值+软阙值)+中值滤波图像去噪【含Matlab源码 462期】.zip
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共9个文件
m:7个
jpg:1个
bmp:1个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 147 浏览量
2024-06-20
16:47:16
上传
评论
收藏 246KB ZIP 举报
温馨提示
Matlab领域上传的代码均可运行,亲测可用,直接替换数据即可,适合小白; 1、代码压缩包内容 主函数:main.m; 调用函数:其他m文件;无需运行 运行结果效果图; 2、代码运行版本 Matlab 2019b;若运行有误,根据提示修改;若不会,私信博主; 3、运行操作步骤 步骤一:将所有文件放到Matlab的当前文件夹中; 步骤二:双击打开main.m文件; 步骤三:点击运行,等程序运行完得到结果; 4、仿真咨询 如需其他服务,可私信博主或扫描博客文章底部QQ名片; 4.1 博客或资源的完整代码提供 4.2 期刊或参考文献复现 4.3 Matlab程序定制 4.4 科研合作 图像去噪:小波阙值、BM3D、BdCNN、DCT、均值、中值、平滑滤波、维纳、PM模型、双边滤波、全变分算法、正则化、即插即用法
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![text/plain](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/BMP.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 9 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/f6819b692a8841f6a058b284bba25c7f_weixin_63266434.jpg!1)
![avatar-vip](https://csdnimg.cn/release/downloadcmsfe/public/img/user-vip.1c89f3c5.png)
Matlab领域
- 粉丝: 2w+
- 资源: 2500
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)