天天看点

matlab中值滤波法算法,基于MATLAB中值滤波算法的优化与实现

总第238期2014年第4期 舰 船 电 子 工 程 Ship Electronic Engineering Vol.34No.437 基于 MATLAB中值滤波算法的优化与实现* 赵建春 刘力源 (陆军军官学院研究生管理大队 合肥 230031) 摘 要 介绍了中值滤波的滤波特点,针对标准中值滤波在滤除椒盐噪声中的不足,提出了一种中值滤波优化算法,通过 MATLAB软件仿真,结果表明该算法在有效地去除椒盐噪声的同时,很好地保护了边缘细节,较标准中值滤波具有更优良的滤波效果。 关键词 中值滤波;椒盐噪声;MATLAB中图分类号 TP317  DOI:10.3969/ j.issn1672-9730.2014.04.011 Optimization of Median FilteringAl gorithm Based on MATLAB ZHAO Jianchun LIU Li yuan ( Graduate Administrative Department,Army Officer Academy,Hefei 230031) Abstract The filtering characteristics of the median filter,according to the standard median filter.In filtering out thedeficiency of the salt and pepper noise,a median filter optimization algorithm is proposed.Through the MATLAB softwaresimulation,the results show that the algorithm effectively removes the salt and pepper noise while protecting the edge details of the standard median filter has better filtering effect. Key Words median filter,salt and pepper noise,MATLAB Class Number TP317 1 引言 非线性滤波[ 1]较传统的线性滤波在滤除噪声的同时,能最大限度地保持图像信号的边缘细节,使图像清晰、逼真,从而得到广泛研究和应用。常用的中值滤波是非线性滤波的代表。虽然典型的中值滤波能够减少图像中的椒盐噪声,但是当椒盐噪声在空间出现的概率较大时,中值滤波器为了滤除噪声,不得不增大滤波窗口,在滤除噪声的同时损失了信号的高频信息,使图像的边缘等细节模糊,产生较严重的失真[ 2~3]。本文对中值滤波算法进行分析,给出中值滤波优化算法,使图像在有效滤除噪声的同时,能较好地保护图像的边缘细节,以提高图像处理效果。 2 中值滤波 中值滤波[ 4]是基于排序统计理论的一种能有 效抑制脉冲噪声的非线性信号处理技术。一个中值滤波器的输出可写为 g ( x , y )= median ( s , t )∈ N ( x , y ) { f ( s , t )} ( 1) 式中, f ( s , t ), g ( x , y )分别为原始图像和处理后图 像, N ( x , y )是以( x , y )为中心的 n × n 矩形滤波窗 口( n 为奇数),median是将滤波窗口中的 n 2个像 素点按灰度值大小排序后取中值,其流程图如图1所示。 图1 中值滤波