课程设计任务书
学生姓名: 专业班级:
指导教师: 工作单位: 武汉理工大学
题 目: 基于 MATLAB的图像滤波设计
初始条件:
(1) Matlab 仿真软件及其相关基本知识,基本操作技能
(2) 基础数学、数字信号处理与图像处理课程相关基础知识
要求完成的主要任务 :
采用 MATLAB 选用适当的函数或矩阵进行如下计算:
(1) 极限的计算、微分的计算、积分的计算、级数的计算、求解代数方程、求解
常微分方程;
(2) 矩阵的最大值、最小值、均值、方差、转置、逆、行列式、特征值的计算、
矩阵的相乘、右除、左除、幂运算;
(3) 多项式加减乘除运算、多项式求导、求根和求值运算、多项式的部分分式展
开、多项式的拟合、插值运算。
基于 MATLAB 的图像滤波设计:
(1) 读入图像并分别加入高斯噪声、椒盐噪声和乘性噪声,并比较结果。
(2) 设计巴特沃斯低通滤波对图像进行低通滤波处理,显示结果。
(3) 设计高斯高通滤波器对图像进行处理,显示结果。
(4) 采用维纳滤波和中值滤波对图像进行处理,显示结果
时间安排:
第 11 周安排任务,分组;
第 12 周设计仿真,撰写报告;
第 13 周完成设计,提交报告,答辩。
指导教师签名: 2012 年 1 月 10 日
系主任(或责任教师)签名: 2012 年 1 月 10 日
武汉理工大学《 MATLAB》课程设计报告
I
目录
摘要 ----------------------------------------------------------------------------------III
Abstract-------------------------------------------------------------------------------IV
1 绪论 ----------------------------------------------------------------------------------1
1.1 MATLAB 基础知识介绍 ------------------------------------------------------------ 1
1.2 滤波器知识简介 ---------------------------------------------------------------- 1
1.2.1 滤波器功能及分类 --------------------------------------------------------- 1
1.2.2 模拟滤波器设计理论 ------------------------------------------------------- 2
1.3 图像数据采集简介 -------------------------------------------------------------- 2
1.3.1 灰度图像 ---------------------------------------------------------------- 2
1.3.2 基于 MATLAB的图像数据采集 ----------------------------------------------- 3
1.4 噪声简介 ---------------------------------------------------------------------- 3
2 MATLAB的基本运算 ---------------------------------------------------------------------5
2.1 基础微积分运算 ---------------------------------------------------------------- 5
2.1.1 极限的计算 -------------------------------------------------------------- 5
2.1.2 微分的计算 -------------------------------------------------------------- 5
2.1.3 积分的计算 -------------------------------------------------------------- 6
2.1.4 级数的计算 -------------------------------------------------------------- 6
2.1.5 求解代数方程 ------------------------------------------------------------ 6
2.1.6 求解常微分方程 ---------------------------------------------------------- 7
2.2 矩阵的基本运算 ---------------------------------------------------------------- 7
2.2.1 矩阵的最大值、最小值 ---------------------------------------------------- 7
2.2.2 矩阵的均值 -------------------------------------------------------------- 8
2.2.3 矩阵的方差 -------------------------------------------------------------- 8
2.2.4 矩阵的转置 -------------------------------------------------------------- 9
2.2.5 矩阵的逆矩阵及矩阵的行列式 ---------------------------------------------- 9
2.2.6 矩阵的特征值 ----------------------------------------------------------- 10
2.2.7 矩阵的相乘、左除、右除 ------------------------------------------------- 10
2.2.8 矩阵的幂运算 ----------------------------------------------------------- 11
2.3 多项式的基本运算 ------------------------------------------------------------- 11
2.3.1 多项式的加、减、乘、除运算 --------------------------------------------- 11
2.3.2 多项式的求导、求根、求值运算 ------------------------------------------- 12
2.3.3 多项式的部分分式展开 --------------------------------------------------- 13
2.3.4 多项式的拟合、插值运算 ------------------------------------------------- 14
3 基于 MATLAB的图像滤波设计 -----------------------------------------------------------16
3.1 读入图像,加入高斯噪声、椒盐噪声、乘性噪声并对比 ----------------------------- 16
3.2 设计巴特沃斯低通滤波器对图像进行低通滤波处理 --------------------------------- 17
3.2.1 对加入高斯噪声的图像进行巴特沃斯低通滤波 ------------------------------- 17
3.2.2 对加入椒盐噪声的图像进行巴特沃斯低通滤波 ------------------------------- 18
3.2.3 对加入乘性噪声的图像进行巴特沃斯低通滤波 -------------------------------- 19
3.2.4 结果分析 --------------------------------------------------------------- 19
3.3 设计高斯高通滤波器对图像进行处理 --------------------------------------------- 19
3.3.1 对加入高斯噪声的图像进行高斯高通滤波 ----------------------------------- 20
3.3.2 对加入椒盐噪声的图像进行高斯高通滤波 ----------------------------------- 21
武汉理工大学《 MATLAB》课程设计报告
II
3.3.3 对加入乘性噪声的图像进行高斯高通滤波 ----------------------------------- 21
3.3.4 结果分析 --------------------------------------------------------------- 21
3.4 采用维纳滤波对图像进行处理 --------------------------------------------------- 22
3.4.1 对加噪后图像采用维纳滤波器处理 ----------------------------------------- 22
3.4.2 结果分析: ------------------------------------------------------------- 23
3.5 采用中值滤波对图像进行处理 --------------------------------------------------- 24
3.5.1 对加噪后图像采用中值滤波器处理 ----------------------------------------- 24
3.5.2 结果分析 --------------------------------------------------------------- 25
3.6 几种滤波方式比较 ------------------------------------------------------------- 25
4 心得体会 ----------------------------------------------------------------------------26
5 参考文献 ----------------------------------------------------------------------------27
武汉理工大学《 MATLAB》课程设计报告
III
摘要
图像常常被强度随机信号 (也称为噪声 )所污染.一些常见的噪声有椒盐噪声、乘性噪
声、高斯噪声等. 椒盐噪声含有随机出现的黑白强度值 ,而乘性噪声则只含有随机的白强度
值(正脉冲噪声 )或黑强度值 (负脉冲噪声 ),与前两者不同,高斯噪声含有强度服从高斯或正
态分布的噪声。研究滤波就是为了消除噪声干扰,图像滤波总体上讲包括空域滤波和频域
滤波。频率滤波需要先进行傅立叶变换至频域处理然后再反变换回空间域还原图像,空域
滤波是直接对图像的数据做空间变换达到滤波的目的。 MATLAB 是一个高级的数学分析与
运算软件,除具备卓越的数值计算能力外,它还提供了专业水平的符号计算,文字处理,
可视化建模仿真和实时控制等强大功能。 MATLAB 的名称来自一矩阵实验室,它表明,
MATLAB 的基本数据单位是矩阵,其指令表达式与数学、工程中常用的形式十分相似,
MATLAB 拥有数百个内部函数和三十几种工具包, 包括功能性工具包和学科工具包, 可以
通过工具包扩充符号计算、可视化建模等功能。
MATLAB 和 Mathematica、Maple 并称为三大数学软件。它在数学类科技应用软件中
在数值计算方面首屈一指。 MATLAB 可以进行矩阵运算、绘制函数和数据、实现算法、 创
建用户界面、连接其他编程语言的程序等,主要应用于工程计算、控制设计、信号处理与
通讯、图像处理、信号检测、金融建模设计与分析等领域。在欧美高校, MATLAB 已经成
为线性代数、自动控制理论、数理统计、数字信号处理、时间序列分析、动态系统仿真等
高级课程的基本教学工具, 成为攻读学位的本科生、 硕士生、博士生必须掌握的基本技能。
在国内,目前各个高校也正在逐步开设相关课程,为广大学生学习和使用 MATLAB 提供
方便。
本文主要应用 MATLAB 软件来讨论与验证针对加入高斯、椒盐、乘性噪声后设计的
巴特沃斯低通滤波、高斯高通滤波、维纳滤波和中值滤波等几种处理噪声的滤波器。
关键词: MATLAB ; 数学运算; 图像处理; 噪声; 滤波器
武汉理工大学《 MATLAB》课程设计报告
IV
Abstract
Random image intensity is often signals (also known as noise) of the pollution. Some
common noise are impulse noise, multiplicative noise, Gaussian noise. Salt and pepper noise with
random black and white intensity value, while the multiplicative noise only with random white
intensity values (positive impulse noise) or black intensity value (negative impulse noise), and the
first two different Gaussian noise with high strength to obey Sri Lanka or the normal distribution
of noise. Of filtering is to eliminate noise, image filtering whole, including spatial filtering and
frequency domain filtering. Frequency filtering need to make the Fourier transform to the
frequency domain and then inverse transform to restore the image back to spatial domain, spatial
filtering is done directly on the image data space transformation to achieve the purpose of filtering.
MATLAB is a high level of mathematical analysis and computational software, in addition to have
excellent numerical skills, it also provides a professional level of symbolic computation, word
processing, visualization, modeling and simulation and real-time control of other powerful
features.
MATLAB and Mathematica, Maple and called three mathematical software. It in math class
technology software applications in other fields numerical calculation. MATLAB can undertake
matrix and drawing function and data, implementation algorithms, create user interface, link to
the rest of the programming language procedure, etc. Are mainly applied in engineering
calculation, control design, signal processing and communication, image processing and signal
detection, financial modeling design and analysis, etc.
This paper to discuss the application of MATLAB software, and validation for adding
Gaussian, salt and pepper, designed by multiplicative noise Butterworth low-pass filter, Gaussian
high-pass filter, Wiener filter and median filter of several treatments such as noise filters .
Keywords: MATLAB, Math, Image Processing, Noise, Filter