Matlab 中值滤波原理分析


1 Median Filtering 中值滤波


The function medfilt1 implements one-dimensional median filtering, a nonlinear technique that applies a sliding window to a sequence.

medfilt1是中值滤波的一维实现,是一种对序列进行滑动窗口处理类的非线性技术。

The median filter replaces the center value in the window with the median value of all the points within the window [5].

在窗口内,中值滤波将中心点数值用所有点的中值来替代。

In computing this median, medfilt1 assumes zeros beyond the input points.

计算中值时,medfilt1假设输入点以外都是0.

When the number of elements n in the window is even, medfilt1 sorts the numbers, then takes the average of the n/2 and n/2 + 1 elements.

当序列的窗口内点数n为偶数个时,medfilt1首先对点号进行排序,然后取n/2和n/2+1个元素的平均。

Two simple examples with fourth- and third-order median filters are

下面给出四阶和三阶中值滤波的例子
medfilt1([4 3 5 2 8 9 1],4)
ans =
    1.500 3.500 3.500 4.000 6.500 5.000 4.500

首先看四阶的,序列为[4 3 5 2 8 9 1]

i=1时,窗口=[0 0 4 3] 第n/2个=0 第n/2+1个=3 均值为1.5

i=2时,窗口=[0 4 3 5] 第n/2个=3 第n/2+1个=4 均值为3.5

i=3时,窗口=[4 3 5 2] 第n/2个=3 第n/2+1个=4 均值为3.5

i=4时,窗口=[3 5 2 8] 第n/2个=3 第n/2+1个=5 均值为4

medfilt1([4 3 5 2 8 9 1],3)
ans =
     3     4     3     5     8     8     1

接下来看三阶的,序列为[4 3 5 2 8 9 1]

当i=1时,窗口=[0 4 3]中值为3

当i

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Intimes

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值