提出一种适用于去除高密度椒盐噪声的图像滤波算法,以进一步提高输出图像的峰值信噪比。利用直方图形状判定椒盐噪声的两种灰度值,用于噪声像素的检测与定位。对于非噪声像素,直接输出灰度值;对于噪声像素,沿其邻域的k个方向分别搜索一个距离最近的非噪声像素,然后以欧式距离倒数为权重,采用k个非噪声像素的加权灰度均值作为噪声像素的输出灰度值。测试了不同的方向数k对滤波性能的影响,确定了k的最佳取值为4。采用该方法对椒盐噪声密度为10%到90%的图像进行滤波,输出图像的峰值信噪比比现有同类方法提高了1.8~4.7 d B。该方法有效提高了高密度椒盐噪声图像的滤波质量,处理速度满足实时要求。
A kind of image filter for high density salt pepper noise is presented so as to further improve the PSNR(Peak Signal to Noise Ratio)of output image. Histogram shape is analyzed to decide the two gray values of salt pepper noises, which are used to detect and locate noise pixels. For each non-noise pixel, its gray level is directly output; for each noisy pixel, the nearest non-noise pixels are searched respectively along k kinds of directions in the neighborhood. Then using reciprocal of Euclidean distance as the weight, the weighted mean of gray levels of these non- noise pixels is used as output. Filter performances with different values of k are tested, which indicates that the optimal value of k is 4. The presented method is used to process images with the salt pepper noise density from 10% to 90%, and the PSNR values of the output images increase by 1.8 ~ 4.7 d B than other similar methods. This method obviously improves the filtering quality of images with high-density salt pepper noise, and the processing speed can meet real-time requirements.