图像处理滤波器(四)——最值滤波器(Conservative Smoothing Filter)

本文介绍了最值滤波器(Conservative Smoothing Filter)在图像处理中的原理,该滤波器通过比较卷积核区域内的最大值和最小值,将中心点的值设置为其最大或最小值之一,从而有效地处理椒盐噪声。实验结果显示,这种滤波器对于椒盐噪声的抑制效果优于其他传统滤波器。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

描述:之所以我把它翻译成最值滤波器,因为它的原理就是在卷积核区域内,中心点的值如果大于或小于附近值的最大值或最小值时,将大于最大值的赋值为最大值,将小于最小值的赋值为最小值,这就是Conservative Smoothing Filter


如下图所示:




这上面的图表明中间点150要换成127,简单点讲就是大于最大值的等于最大值,小于最小值的等于最小值,在最小值和最大值之间的值不变。


Code:

  /**
   * Finds the maximum value from a 3x3 pixel neighbourhood overlaid with
   * a 3x3 kernel (on/off). The centre pixel of the kernel is ignored.
   *
   * @param input The 2D array of pixel values representing the image.
   * @param kernel The array representing the kernel.
   * @param w The width of the image.
   * @param h The height of the image.
   * @param x The x coordinate of the centre of the 3x3 neighbourhood.
   * @param y The y coordinate of the centre of the 3x3 neighbourhood.
   * @return The maximum value.
   */
  public static int maxNeighbour(int [][]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值