medianBlur 中值滤波

中值滤波是基于排序统计理论的一种能有效抑制噪声的非线性信号处理技术,对脉冲噪声有良好的滤除作用,特别是在滤除噪声的同时,能够保护信号的边缘,使之不被模糊。这些优良特性是线性滤波方法所不具有的。此外,中值滤波的算法比较简单,也易于用硬件实现。

中值滤波就是将当前像素值替换为模板覆盖范围内的所有像素值中大小居中那一个:对于一个3*3的模板,第5大的就是中值:

(10,15,20,20,20,20,20,25,100)

中值滤波使得那些更亮(或者更暗)的点更像他周围的值。所以它在滤除噪音的同时,可以较好地保留细节轮廓.

函数说明

void cv::medianBlur(InputArray src,
  OutputArray dst,
  int ksize 
 )  

Blurs an image using the median filter.

The function smoothes an image using the median filter with the ksize×ksize  aperture. Each channel of a multi-channel image is processed independently. In-place operation is supported.

Parameters
srcinput 1-, 3-, or 4-channel image; when ksize is 3 or 5, the image depth should be CV_8U, CV_16U, or CV_32F, for larger aperture sizes, it can only be CV_8U.
dstdestination array of the same size and type as src.
ksizeaperture linear size; it must be odd and greater than 1, for example: 3, 5, 7 ...
See also
bilateralFilter, blur, boxFilter, GaussianBlur
Examples:
houghcircles.cpp, and laplace.cpp.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值