去噪算法 matlab,经典滤波算法去噪对比实验(Matlab实现)
# 一,经典滤波算法的基本原理
###1,中值滤波和均值滤波的基本原理
参考以前转载的博客:http://blog.csdn.net/ebowtang/article/details/38960271
###2,高斯平滑滤波基本原理
参考以前转载的博客:http://blog.csdn.net/ebowtang/article/details/38389747
# 二,噪声测试效果
### 1,不同噪声效果
三幅图各噪声浓度分别是0.01 0.03,0.05(比如第一副图均是加入0.01的噪声浓度)
![](https://box.kancloud.cn/2016-03-02_56d6526a079a1.jpg)
![](https://box.kancloud.cn/2016-03-02_56d6526a23bdb.jpg)
![](https://box.kancloud.cn/2016-03-02_56d6526a3da52.jpg)
### 2,实验代码
~~~
%读入原始图像并显示
image_original=imread('dog.bmp');
figure(1)
subplot(2,4,1);
imshow(image_original);
title('原输入图像');
axis square;
%生成含高斯噪声图像并显示
pp=0.05;
image_gaosi_noise=imnoise(image_original,'gaussian',0,pp);
subplot(2,4,2);
imshow(image_gaosi_noise);
title('添加高斯噪声后图像');
axis square;
%生成含椒盐噪声图像并显示
d=0.05;
image_saltpepper_noise=imnoise(image_original,'salt & pepper',d);
subplot(2,4,3);
imshow(image_saltpepper_noise);
title('添加椒盐噪声后图像');
axis square;
%生成含乘性噪声图像并显示
var=0.05;
image_speckle_noise=imnoise(image_original,'speckle',var);
subplot(2,4,4);
imshow(image_speckle_noise);
title('添加乘性噪声后图像');
axis square;
%原图像直方图
r=0:255;
bb=image_original(:);
pg=hist(bb,r);
pgr1=pg/length(bb);
subplot(245);bar(pgr1);title('源输入图像的直方图');
r=0:255;
bl=image_gaosi_noise(:);
pg=hist(bl,r);
pgr2=pg/length(bl);
subplot(246);bar(pgr2);title('高斯噪声污染后的直方图');
r=0:255;
bh=image_saltpepper_noise(:);
pu=hist(bh,r);
pgr3=pu/length(bh);
subplot(247);bar(pgr3);title('椒盐噪声污染后的直方图');
r=0:255;
ba=image_speckle_noise(:);
pa=hist(ba,r);
pgr4=pa/length(ba);
subplot(248);bar(pgr4);title('乘性噪声污染后直方图');
~~~
# 三,椒盐噪声去除能力对比
### 1,三大去噪效果
三幅图椒盐噪声浓度分别是0.01 0.03,0.05(比如第一副图均是加入0.01的椒盐噪声去噪对比)
![](https://box.kancloud.cn/2016-03-02_56d6526a561cb.jpg)
![](https://box.kancloud.cn/2016-03-02_56d6526a6bde4.jpg)
![](https://box.kancloud.cn/2016-03-02_56d6526a858cc.jpg)
### 2,实现代码
~~~
%读入原始图像并显示
image_original=imread('dog.bmp');
figure(1)
subplot(2,4,1);
imshow(image_original);
title('原输入图像');
axis square;
%生成含高斯噪声图像并显示
%pp=0.05;
%image_gaosi_noise=imnoise(image_original,'gaussian',0,pp);
%生成含椒盐噪声图像并显示
dd=0.05;
image_saltpepper_noise=imnoise(image_original,'salt & pepper',dd);
%生成含乘性噪声图像并显示
%var=0.05;
%image_speckle_noise=imnoise(image_original,'speckle',var);
image_saltpepper_noise_after1=medfilt2(image_saltpepper_noise,[3,3]);
subplot(2,4,2);
imshow(image_saltpepper_noise_after1);title('中值滤波去椒盐噪声效果图');
axis square;
h_gaosi1=fspecial('gaussian',3,1);
image_saltpepper_noise_after2=imfilter(image_saltpepper_noise,h_gaosi1);
subplot(2,4,3);
imshow(image_saltpepper_noise_after2);title('高斯平滑去椒盐噪声效果');
axis square;
image_saltpepper_noise_after3=wiener2(image_saltpepper_noise,[5 5]);
subplot(2,4,4);
imshow(image_saltpepper_noise_after3);title('维纳滤波去椒盐噪声效果');
axis square;
%原图像直方图
r=0:255;
bb=image_original(:);
pg=hist(bb,r);
pgr1=pg/length(bb);
subplot(245);bar(pgr1);title('源输入图像的直方图');
r=0:255;
bl=image_saltpepper_noise_after1(:);
pg=hist(bl,r);
pgr2=pg/length(bl);
subplot(246);bar(pgr2);title('中值滤波去椒盐噪声后的直方图');
r=0:255;
bh=image_saltpepper_noise_after2(:);
pu=hist(bh,r);
pgr3=pu/length(bh);
subplot(247);bar(pgr3);title('高斯平滑去椒盐噪声后的直方图');
r=0:255;
ba=image_saltpepper_noise_after3(:);
pa=hist(ba,r);
pgr4=pa/length(ba);
subplot(248);bar(pgr4);title('维纳滤波去除椒盐噪声后的直方图');
~~~
# 四,高斯噪声去除能力对比
### 1,去噪效果对比
![](https://box.kancloud.cn/2016-03-02_56d6526aa186a.jpg)
![](https://box.kancloud.cn/2016-03-02_56d6526ac1bee.jpg)
![](https://box.kancloud.cn/2016-03-02_56d6526ae8bee.jpg)
### 2,实验代码
~~~
%读入原始图像并显示
image_original=imread('dog.bmp');
figure(1)
subplot(2,4,1);
imshow(image_original);
title('原输入图像');
axis square;
%生成含高斯噪声图像并显示
pp=0.05;
image_gaosi_noise=imnoise(image_original,'gaussian',0,pp);
%生成含椒盐噪声图像并显示
%dd=0.01;
%image_saltpepper_noise=imnoise(image_original,'salt & pepper',dd);
%生成含乘性噪声图像并显示
%var=0.05;
%image_speckle_noise=imnoise(image_original,'speckle',var);
image_gaosi_noise_after1=medfilt2(image_gaosi_noise,[3,3]);
subplot(2,4,2);
imshow(image_gaosi_noise_after1);title('中值滤波去高斯噪声效果图');
axis square;
h_gaosi1=fspecial('gaussian',3,1);
image_gaosi_noise_after2=imfilter(image_gaosi_noise,h_gaosi1);
subplot(2,4,3);
imshow(image_gaosi_noise_after2);title('高斯平滑去高斯噪声效果');
axis square;
image_gaosi_noise_after3=wiener2(image_gaosi_noise,[5 5]);
subplot(2,4,4);
imshow(image_gaosi_noise_after3);title('维纳滤波去高斯噪声效果');
axis square;
%原图像直方图
r=0:255;
bb=image_original(:);
pg=hist(bb,r);
pgr1=pg/length(bb);
subplot(245);bar(pgr1);title('源输入图像的直方图');
r=0:255;
bl=image_gaosi_noise_after1(:);
pg=hist(bl,r);
pgr2=pg/length(bl);
subplot(246);bar(pgr2);title('中值滤波去高斯噪声后的直方图');
r=0:255;
bh=image_gaosi_noise_after2(:);
pu=hist(bh,r);
pgr3=pu/length(bh);
subplot(247);bar(pgr3);title('高斯平滑去高斯噪声后的直方图');
r=0:255;
ba=image_gaosi_noise_after3(:);
pa=hist(ba,r);
pgr4=pa/length(ba);
subplot(248);bar(pgr4);title('维纳滤波去除高斯噪声后的直方图');
~~~
# 五,乘性噪声去除能力对比
### 1,去噪效果对比
![](https://box.kancloud.cn/2016-03-02_56d6526b0fcaf.jpg)
![](https://box.kancloud.cn/2016-03-02_56d6526b2a4a6.jpg)
![](https://box.kancloud.cn/2016-03-02_56d6526b3f248.jpg)
### 2,实验代码
~~~
%读入原始图像并显示
image_original=imread('dog.bmp');
figure(1)
subplot(2,4,1);
imshow(image_original);
title('原输入图像');
axis square;
%生成含高斯噪声图像并显示
%pp=0.01;
%image_gaosi_noise=imnoise(image_original,'gaussian',0,pp);
%生成含椒盐噪声图像并显示
%dd=0.01;
%image_saltpepper_noise=imnoise(image_original,'salt & pepper',dd);
%生成含乘性噪声图像并显示
var=0.01;
image_speckle_noise=imnoise(image_original,'speckle',var);
image_speckle_noise_after1=medfilt2(image_speckle_noise,[3,3]);
subplot(2,4,2);
imshow(image_speckle_noise_after1);title('中值滤波去乘性噪声效果图');
axis square;
h_gaosi1=fspecial('gaussian',3,1);
image_speckle_noise_after2=imfilter(image_speckle_noise,h_gaosi1);
subplot(2,4,3);
imshow(image_speckle_noise_after2);title('高斯平滑去乘性噪声效果');
axis square;
image_speckle_noise_after3=wiener2(image_speckle_noise,[5 5]);
subplot(2,4,4);
imshow(image_speckle_noise_after3);title('维纳滤波去乘性噪声效果');
axis square;
%原图像直方图
r=0:255;
bb=image_original(:);
pg=hist(bb,r);
pgr1=pg/length(bb);
subplot(245);bar(pgr1);title('源输入图像的直方图');
r=0:255;
bl=image_speckle_noise_after1(:);
pg=hist(bl,r);
pgr2=pg/length(bl);
subplot(246);bar(pgr2);title('中值滤波去乘性噪声后的直方图');
r=0:255;
bh=image_speckle_noise_after2(:);
pu=hist(bh,r);
pgr3=pu/length(bh);
subplot(247);bar(pgr3);title('高斯平滑去乘性噪声后的直方图');
r=0:255;
ba=image_speckle_noise_after3(:);
pa=hist(ba,r);
pgr4=pa/length(ba);
subplot(248);bar(pgr4);title('维纳滤波去除乘性噪声后的直方图');
~~~
# 六,PNSR客观对比
(PNSR客观对比越高越好)
本对比也囊括了其他常见去噪方式的对比
![](https://box.kancloud.cn/2016-03-02_56d6526b5f9bd.jpg)
#参考资源
【1】《百度百科》
【2】《维基百科》
【3】冈萨雷斯《数字图像处理》
【4】http://blog.csdn.net/ebowtang/article/details/38960271
去噪算法 matlab,经典滤波算法去噪对比实验(Matlab实现)相关推荐
- Matlab自适应滤波算法 LMS小白通俗易懂版
Matlab自适应滤波算法 在学习自适应算法的过程中,入门阶段,学习了LMS算法.NLMS算法,并用Matlab对算法进行了复现. LMS 最小均方(LMS)是一种搜索算法,它通过对目标函数进行适当修 ...
- c语言滤出是个最小值,经典滤波算法及C语言程序
<经典滤波算法及C语言程序>由会员分享,可在线阅读,更多相关<经典滤波算法及C语言程序(9页珍藏版)>请在人人文库网上搜索. 1.经典的滤波算法经典的滤波算法 可以用用可以用用 ...
- SLAM算法总结——经典SLAM算法框架总结
SLAM算法总结--经典SLAM算法框架总结 SLAM算法总结--经典SLAM算法框架总结 SLAM算法总结--经典SLAM算法框架总结 从研究生接触SLAM算法到现在也有两三年了,期间学习了很多经典 ...
- 【图像融合】基于matlab导向滤波图像融合【含Matlab源码 1959期】
⛄一.获取代码方式 获取代码方式1: 完整代码已上传我的资源:[图像融合]基于matlab导向滤波图像融合[含Matlab源码 1959期] 点击上面蓝色字体,直接付费下载,即可. 获取代码方式2: ...
- 极值滤波matlab,极值滤波算法MATLAB程序及处理结果对比
<极值滤波算法MATLAB程序及处理结果对比>由会员分享,可在线阅读,更多相关<极值滤波算法MATLAB程序及处理结果对比(5页珍藏版)>请在人人文库网上搜索. 1.极值滤波算 ...
- 【Matlab经典智能算法】新手入门第十六天
经典智能算法 前言 1.免疫算法的MATLAB实现 1.1基本原理 1.2程序设计 1.3经典应用 2.小波分析算法的MATLAB实现 2.1基本原理 2.2程序设计 2.3经典应用 3.PID控制器 ...
- 【老生谈算法】matlab实现LMS算法的自适应滤波算法源码——自适应滤波
基于matlab的LMS算法的自适应滤波 1.文档下载: 本算法已经整理成文档如下,有需要的朋友可以点击进行下载 序号 文档(点击下载) 本项目文档 [老生谈算法]基于LMS的MATLAB大作业.do ...
- KCF算法(相关滤波算法) 跟踪目标
这是笔者目前碰到的性能最好的传统目标跟踪算法,所以这里也简单介绍下这个算法的由来. 一.算法介绍 KCF全称为Kernel Correlation Filter 核相关滤波算法.是在2014年由Joa ...
- java 滤波算法_双边滤波算法
1.原理 高斯滤波是以距离为权重,设计滤波模板作为滤波系数,只考虑了像素间的空间位置上的关系,因此滤波的结果会丢失边缘的信息. 高斯滤波的缺陷如下图所示:平坦区域正常滤波,图像细节没有变化,而在突变的 ...
最新文章
- 当代成年人的生活状态......
- 【计算机网络】信息与信号
- 查看python所有内置方法_python 内置方法
- 阿里云、百度云被约谈 督促落实防范治理电信网络诈骗
- Redis之Pipeline(管道)
- 趣谈新春年俗:古代过年为啥要贴门神像?
- 微信模板消息字体设置变大
- win10 Kafka环境搭建 + 编译C++(librdkafka) 封装库
- 三维模型免费查看器(AnyCAD Viewer)
- 环境可靠性测试,气候环境类可靠性试验,可靠性测试标准
- 微信公众号开发引导用户关注公众号
- 骇客基础知识:第3部分
- Windows bat脚本获取administrator权限
- 学习AngularJS摘抄的笔记,方便以后查看(摘自菜鸟教程)
- 网络号、主机号、子网掩码、IP、子网划分、主机号划分
- Ubuntu16.04系统联网(连接WiFi)设置(亲测有效!!!)
- 2018年互联网技术岗(数据分析)暑期实习面试经验
- 俄语33个字母+编程打印俄语字母表
- 408总线的串并行分类及系统总线局部总线分类
- 【正版软件】激活Windows 7报0xC004F035错误
热门文章
- java实现监听文件
- DevOps相关知识点
- 竹笋炒肉转载 -- 读《Effective java 中文版》(2)
- 如何优雅地实现C++编译期多态?
- Joshua Loth Liebman
- 异质化社群量化研究4丨RATE OF CHANGE WITH BANDS
- 王者荣耀微信哪个服务器人多,明明是用微信的比用QQ的多,那为何王者荣耀QQ区人更多?...
- 相机标定(2): 单目相机标定总结
- 《Linux命令行与Shell脚本编程大全》读后感
- STM32通用FLASH管理软件包——SFUD/FAL