Figures
Abstract
In this paper, a two-stage filter for removing salt-and-pepper noise using noise detector based on characteristic difference parameter and adaptive directional mean filter is proposed. The first stage firstly detects the noise corrupted pixels by combining characteristic difference parameter and gray level extreme, then develops an improved adaptive median filter to firstly restore them. The second stage introduces a restoration scheme to further restore the noise corrupted pixels, which firstly divides them into two types and then applies different restoration skills for the pixels based on the classification result. One type of pixels is restored by the mean filter and the other type of pixels is restored by the proposed adaptive directional mean filter. The new filter firstly adaptively selects the optimal filtering window and direction template, then replaces the gray level of noise corrupted pixel by the mean value of pixels on the optimal template. Experimental results show that the proposed filter outperforms many existing main filters in terms of noise suppression and detail preservation.
Citation: Ma H, Nie Y (2018) A two-stage filter for removing salt-and-pepper noise using noise detector based on characteristic difference parameter and adaptive directional mean filter. PLoS ONE 13(10): e0205736. https://doi.org/10.1371/journal.pone.0205736
Editor: Zhaoqing Pan, Nanjing University of Information Science and Technology, CHINA
Received: November 24, 2017; Accepted: September 26, 2018; Published: October 26, 2018
Copyright: © 2018 Ma, Nie. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Data Availability: All relevant data are within the paper and its Supporting Information files.
Funding: Our work is supported by National Natural Science Foundation of China (No.11471262).
Competing interests: The authors have declared that no competing interests exist.
1 Introduction
Digital images can be corrupted by impulse noise due to bit errors in the process of image acquisition and transmission [1–3]. Salt-and-pepper noise and random-valued noise are the two common types of impulse noise [4]. The salt-and-pepper noise can corrupt an image where each corrupted pixel takes either the maximum or minimum gray level. The salt-and-pepper noise can not only significantly deteriorate the quality of an image, but also bring some difficulty to the subsequent image analysis such as image segmentation [5], edge detection [6] and classification [7, 8]. The goal of image denoising is removing noise as much as possible meanwhile preserving more edges and details. Hence, how to effectively remove the salt-and-pepper noise from corrupted images, keeps to be an important research task in image processing.
During the past several decades, many techniques have been developed to restore the corrupted image, such as the blind denoising method [9, 10] and total-variation denoising method [11, 12]. Among the traditional denoising methods, the standard median filter is one of the most popular nonlinear filters for the removal of salt-and-pepper noise in terms of its good denoising capability and computational efficiency [13]. The standard median filter uniformly replaces the gray level of each noise corrupted pixel by the median gray level of its neighborhood pixels. Hence, the standard median filter is effective in the case of low noise density. While the noise density is higher than 50%, the size of filtering window should to be enlarged to suppress serious noise which leads edges and details to be blurred. In order to improve noise suppression and detail preservation simultaneously, many modified median filters have been developed, such as the weighted median (WM) filter [14, 15], the adaptive median (AM) filter [16, 17] and the switching median (SM) filter [18–20].
The weighted median (WM) filter [14] is developed to improve the standard median filter by introducing the weighted technique. For all pixels in an image, the WM filter selects various weights for pixels at different positions in the window to restore the gray level of central pixel. Hence, the WM filter can achieve the better restoration result than the standard median filter. Different from the WM filter, the adaptive median (AM) filter [16] chooses the median gray level in an adaptive window for each pixel which overcomes the drawback of fixed window in standard median filter. Therefore, the AM filter can perform better than the standard median filter. The switching median (SM) filter [20] is a popular type of salt-and-pepper noise removing technique in recent years. The SM filter partitions the filtering process into two steps: noise detection and noise restoration. In the first step, the noise corrupted pixels are distinguished from the noise-free ones based on the noise detector. After noise detection, the gray level of each noise corrupted pixel will be replaced by the median gray level of its neighborhood pixels. The SM filter has a major drawback that the size of filtering window is fixed in the noise detection stage, which cannot effectively detect all noise corrupted pixels. In order to improve the image restoration result, many modified filters have been developed [21–23].
The modified decision based unsymmetric trimmed median (MDBUTM) [24] filter is proposed for removing salt-and-pepper noise which detects the noise corrupted pixels based on the gray level extreme and adaptively replaces the gray level of noise corrupted pixel by the mean or median variant according to the number of gray level extreme in the filtering window. The switching median filter with boundary discriminative noise detection (BDND) [25] is proposed to identify all noise corrupted pixels by adaptively selecting the filtering window of suitable size. The directional weighted median (DWM) filter [26] firstly takes into account the neighborhood information of each pixel along four directions, then uses the minimum sun of directional weighted gray level differences to detects the noise corrupted pixels, finally replaces the gray level of each noise corrupted pixel by the weighted median gray level of its neighboring pixels. The modified directional weighted median (MDWM) filter [27] is developed based on the DWM filter, which considers the neighborhood information of each pixel on more edge directions and selects the weighted median gray level excluding gray level extremes on the optimal direction as the restored gray level of the noise corrupted pixel. After deeply analyzing the DWM filter and MDWM filter, the modified directional weighted (MDW) filter [28] is proposed which firstly detects the noise corrupted pixels based on the directional gray level difference and gray level extreme, then restores each noise corrupted pixel by the weighted mean gray level of the neighborhood pixels. Besides, many other good filters are proposed in recent years. The adaptive iterative fuzzy (AIF) filter [29] is developed to restore the high density noise corrupted image which firstly detects the noise corrupted pixels with an adaptive fuzzy detector and then restores the noise corrupted pixels by a weighted mean filter. The three-values-weighted (TVW) approach [30] is proposed to restore the corrupted image, which firstly employs a variable-size local window to analyze each pixel with extreme values and classifies the non-extreme pixel as the maximum, the middle, or the minimum groups in the local window, then employs the ratios of these three groups to weight the non-extreme pixels, finally replaces the gray level of central pixel by the weighted gray level. The adaptive Type-2 fuzzy (ATF) approach [31] is proposed to remove salt-and-pepper noise which identifies the pixels based on their primary membership function values and then restores the noise corrupted pixels based on the detection results.
After deeply analyzing the performance of the existing main filters appeared in the literatures, we can find two disadvantages of their denoising schemes. One disadvantage is that most of them fail to perform well in the case of various noise densities. The other one is that although they can remove the salt-and-pepper noise from the image corrupted by high noise density, they still lead some important edges and details to be blurred. For more details, you can check the corresponding experimental results in section 3. In order to overcome the drawbacks, we propose a new two-stage filter for removing salt-and-pepper noise using noise detector based on characteristic difference parameter and adaptive directional mean filter in this paper. The proposed filter can effectively and accurately identify the noise corrupted pixels by combining the characteristic difference parameter and gray level extreme. After noise detection, the noise corrupted pixels are firstly restored by the improved adaptive median filter while the noise-free pixels are left unchanged to maintain image features. The second restoration scheme can achieve the better restoration result by proposing the adaptive directional mean filter. Compared with the above introduced filters, the proposed filter can not only effectively and accurately detect the salt-and-pepper noise, but also provide better image restoration performance in the case of various noise densities.
The other parts of this paper are organized as follows. In Section 2, we introduce the proposed method framework. Section 3 provides a number of experimental results to demonstrate the performance of the new method. Conclusions are finally drawn in Section 4.
2 The proposed filter
The proposed filter is composed of two stages: primary filtering stage and second restoration stage. The primary filtering stage firstly detects the noise corrupted pixels by combining the characteristic difference parameter and gray level extreme and then restores them by the improved adaptive median filter. In order to achieve the better restoration result, the second stage introduces a restoration scheme to secondly restore the gray levels of noise corrupted pixels. The restoration scheme firstly divides all the noise corrupted pixels into two types based on the value of characteristic difference parameter and then applies two different restoration skills for the pixels based on the classification result. And one type of pixels is secondly restored by the mean filter while the other type of pixels is secondly restored by the proposed adaptive directional mean filter. Fig 1 is the flow chart of the proposed filter.
2.1 Primary filtering stage
2.1.1 Noise detection.
In an image corrupted by salt-and-pepper noise, the gray level of noise corrupted pixel takes either the maximum or minimum gray level. Hence, the traditional switching median filter identifies the pixel with the maximum or minimum gray level as a noise corrupted pixel. However, the pixels with gray level extreme are not all the noise corrupted pixels. Therefore, the noise detector based on the judgement of gray level extreme cannot accurately detect the noise corrupted pixels. In order to achieve the better detection result, the proposed filter designs an improved noise detector by combining the characteristic difference parameter and gray level extreme.
Before introducing the characteristic difference parameter, the gray level difference is firstly introduced to compare the gray levels of two pixels. For any one pixel Pi,j in a corrupted image, the gray level difference Gk between the pixel Pi,j and its neighborhood pixel is calculated as follows:
(1)
where (sk, tk) ∈ Ω, Ω denotes a detection window whose radius is w. gi,j and
denote the gray level of pixel Pi,j and
, respectively.
After that, a parameter T is selected as the threshold to judge the value of gray level difference. Considering that the parameter has a close relation with the corrupted image, the value of the parameter is varying based on various images. And in the proposed filter, the parameter is selected based on the statistical result for the gray levels of all pixels in the corrupted image. Besides, the size of the detection window is a key factor of affection on noise detection performance. The size of the detection window should be small in the case of low noise density but be large in the case of high noise density. Hence, the detection windows with different sizes are used for the corrupted image. After a number of experiments, it can be seen that the sizes of 3 × 3 and 5 × 5 are suitable while the noise density is lower than 50%; while the noise density locates between 60% and 80%, size of 7 × 7 is usually the best choice, and the size of 9 × 9 is suitable for the 90% noise density. Then the gray level difference between central pixel Pi,j and its neighborhood pixel can be judged by comparing the values of Gk and T as follows:
- If Gk > T, it means that the gray level difference between pixel Pi,j and
is large.
- If Gk ≤ T, it means that the gray level difference between pixel Pi,j and
is small.
Based on the above analysis, it can be judged that whether the gray level difference between central pixel and each neighborhood pixel in the detection window is large. However, the comprehensive gray level difference between central pixel and all neighborhood pixels in the detection window cannot be obtained. Hence, a characteristic difference parameter is introduced to solve the problem. For any one pixel Pi,j in the corrupted image, its characteristic difference parameter Ci,j is calculated as follows:
- According to formula (1), calculate the gray level difference Gk between central pixel Pi,j and its neighborhood pixel
in the detection window one by one.
- Compare the values of gray level difference Gk and threshold T, if Gk > T, the characteristic difference parameter
(2)
The characteristic difference parameter can reflect the comprehensive gray level difference between the central pixel and its neighborhood pixels in the detection window, which can be used to judge that whether the central pixel is a noise corrupted pixel. The detailed analysis is given as follows:
- If pixel Pi,j is an edge pixel, the gray level of pixel Pi,j is close to the gray levels of its neighborhood pixels on the edge direction but different from the gray levels of other neighborhood pixels in the detection window. Then the gray level difference between central pixel and its neighborhood pixel on the edge direction is small and less than the value of threshold T. But the gray level difference between central pixel and other neighborhood pixels is large and greater than the value of threshold T. Since the number of neighborhood pixels on the edge direction is less than the number of other neighborhood pixels, the characteristic difference parameter Ci,j is large. However, considering that the number of neighborhood pixels on the edge direction is at least 2w, the characteristic difference parameter Ci,j is less than or equal to 2w(2w + 1).
- If pixel Pi,j is a noise-free pixel in a flat region, the gray levels of all pixels in the detection window are close. Then the gray level difference between central pixel and each neighborhood pixel is much small and less than the value of threshold T. Hence, the value of characteristic difference parameter Ci,j is small and less than 2w(2w + 1).
- If the central pixel Pi,j is a noise corrupted pixel located on an edge, the gray level of pixel Pi,j is much different from the gray levels of its neighborhood pixels in the detection window while the gray levels of pixels on the edge direction are close. But the gray level difference between central pixel and each neighborhood pixel is large and greater than the value of threshold T. Hence, the characteristic difference parameter Ci,j is large and greater than 2w(2w + 1).
- If pixel Pi,j is a noise corrupted pixel in a flat region, the gray level of pixel Pi,j is much different from the gray levels of its neighborhood pixels in the detection window while the gray levels of its neighborhood pixels are close. Then the gray level difference between central pixel and each neighborhood pixel is large and greater than the value of threshold T. Hence, the characteristic difference parameter Ci,j is large and greater than 2w(2w + 1).
From the above analysis, it can be learned that the characteristic difference parameter can be used to distinguish noise corrupted pixels from noise-free ones in a corrupted image. And the threshold is selected to judge the value of characteristic difference parameter. The value of the threshold to is equal to the number of all the pixels except for the pixels on the diagonal in the detection window. Then the proposed filter can effectively and accurately detect the noise corrupted pixels by combining characteristic difference parameter and gray level extreme. And for any one pixel Pi,j, its characteristic can be identified in the following way:
(3)
where N and S denote the noise corrupted pixels and noise-free ones, respectively. w is the radius of the detection window. gi,j is the gray level of pixel Pi,j.
The pseudo codes of the process of noise detection are provided as follows:
For each pixel Pi,j in the corrupted image:
Ci,j = 0.
For in Ω.
.
if Gk > T
Ci,j = Ci,j + 1.
end
if Ci,j > 2w (2w + 1) and gi,j ∈ {0,255}
Pi,j ∈ N.
else
Pi,j ∈ S.
end
end
2.1.2 First noise restoration.
After noise detection, an improved adaptive median filter is introduced to firstly restore the gray levels of the noise corrupted pixels. And for each noise corrupted pixel, its gray level is replaced by the mean value of the gray levels of its neighboring pixels in the adaptive window. However, the noise-free ones are left unchanged to maintain the features of the original image. The primary filtering process is given as follows:
- For any one pixel pi,j in the corrupted image, select a detection window of suitable size with a small radius w and set the maximum radius of the detection window to be wmax.
- Compare
,
and
, which are the maximum value, minimum value and median value among the gray levels of the pixels in the detection window, respectively.
- If
, then go to the step 5) and calculate the characteristic difference parameter Ci,j; Otherwise, w = w + 1.
- If w ≤ wmax, go to the step 2); Otherwise, the restoration gray level of the pixel
, and stop.
- If
and Ci,j > 2w(2w + 1), the pixel pi,j is corrupted, and the restoration gray level of the pixel
; Otherwise, the pixel pi,j is uncorrupted,
, and stop.
On this basis, according to the result of noise detection the primary restoration gray level of the pixel pi,j is calculated as follows:
(4)
where imadpmed() denotes the improved adaptive median filter.
2.2 Second restoration stage
2.2.1 Noise classification.
Since the improved adaptive median filter cannot restore the corrupted image well in the case of high noise density, the second stage introduces a restoration scheme to secondly restore the gray levels of noise corrupted pixels. Considering that the characteristic difference parameter can reflect the comprehensive gray level difference between each pixel and its neighborhood pixels in a local window, then before the second restoration, the restoration scheme firstly divides all the noise corrupted pixels into two types based on the value of characteristic difference parameter in a 3 × 3 window. And then according to the classification result two different restoration skills are used to secondly restore the noise corrupted pixels. Besides, the gray levels of noise-free pixels are still left unchanged to maintain image features.
Refer to the calculation process of the characteristic difference parameter in the previous section, for the noise corrupted pixel pi,j, its characteristic difference parameter in the 3 × 3 window Ω3 centered at the position (i, j) is calculated as follows:
- According to the formula (1), calculate the gray level difference
between central pixel pi,j and its neighborhood pixel
in the window Ω3 one by one.
- Compare the values of gray level difference
and threshold T, if
, the characteristic difference parameter
.
Since the radius of the 3 × 3 window is 1, the threshold for characteristic difference parameter is selected to be 6. Then based on the value of characteristic difference parameter
, the comprehensive gray level difference between the noise corrupted pixel pi,j and its neighborhood pixels after primary filtering is judged as follows:
- If
, it means that after primary filtering the gray level of noise corrupted pixel pi,j is not much different from the gray levels of its neighborhood pixels.
- If
, it means that after primary filtering the gray level of noise corrupted pixel pi,j is much different from the gray levels of its neighborhood pixels.
According to the above judgement process, the comprehensive gray level differences between each noise corrupted pixel and all the neighborhood pixels in the 3 × 3 window can be judged. And based on the judgement result, all the noise corrupted pixels after primary filtering can be divided into two types. Among all the noise corrupted pixels, the noise corrupted pixels whose characteristic difference parameters in the 3 × 3 window are greater than 6 belong to one type and the rest of the noise corrupted pixels belong to the other type.
2.2.2 Second noise restoration.
Based on the above noise classification result, two different restoration skills will be applied for the noise corrupted pixels. The noise corrupted pixels, whose characteristic difference parameters in the the 3 × 3 window are greater than 6, are secondly restored by the proposed adaptive directional mean filter. And the rest of the noise corrupted pixels are secondly restored by the mean filter in the 3 × 3 window. Then for any one pixel pi,j, its second restoration gray level is calculated according to the following different situations:
(5)
where mean3() denotes the mean filter with the filtering window of size 3 × 3. adpdir() is the proposed adaptive directional mean filter.
The adaptive directional mean filter is developed to restore the gray levels of noise corrupted pixels based on the multi-directional image information. Firstly, the proposed filter designs four direction filtering templates in the filtering windows with different size, then adaptively selects the optimal filtering window and direction template according to the characteristics of pixels in the neighborhood, finally replaces the gray level of each noise corrupted pixel by the mean value of the gray levels of pixels on the optimal direction template. The detailed process of the adaptive directional mean filter is given as follows:
Step 1: Establish a filtering window of size 3 × 3 as shown in Fig 2(A) and design four direction templates as shown in Fig 2(B).
(A) 3 × 3 filtering window. (B) Four direction templates.
At first, it should be judged that whether the optimal direction template can be selected from the four direction templates in the 3 × 3 filtering window. And the judgement condition is that all the pixels except for the central pixel on each direction template are noise-free pixels or second restored pixels. Considering that the filtering order of the denoising method are from left to right and from top to bottom, pixels P1, P2, P3, P4 are noise-free pixels or second restored pixels. Then, only if all the pixels P6, P7, P8, P9 are noise-free pixels, the optimal direction template can be selected from the four templates in the 3 × 3 filtering window. Otherwise, the size of the filtering window need to be further enlarged as shown in the next step. The selection process of the optimal direction template is as follows:
- Calculate the absolute gray level difference al of the pixels on every direction template El except for the central pixel as follows:
(6) where l(1 ≤ l ≤ 4) is the direction index,
and
denote the gray levels of the pixels at the position (s1, t1) and (s2, t2) of the filtering template El, respectively.
- Identify the minimum gray level difference
among the four absolute gray level differences as follows:
(7)
- Select the direction template with the minimum gray level difference as the optimal one, and denote it as
.
After selecting the optimal direction template, the noise-free pixels and the second restored pixels on the optimal direction template are selected to restore the gray level of the central pixel. And in this step, two pixels on the optimal direction template are selected to restore the gray level of the central pixel. Then the second restoration gray level is the mean gray level of the two pixels on the optimal direction template and it is calculated as follows:
(8)
where
and
denote the gray levels of the pixels at the position (s1, t1) and (s2, t2) of the optimal direction template
, respectively.
Besides, if the pixels P6, P7, P8, P9 are not all noise-free pixels, the optimal direction template cannot be selected from the four templates in the 3 × 3 window and the next step will be performed.
Step 2: Enlarge the size of filtering window to be 5 × 5 as shown in Fig 3(A) and design four direction templates as shown in Fig 3(B).
(A) 5 × 5 filtering window. (B) Four direction templates.
Similar to the previous step, it should be judged that whether the optimal direction template can be selected from the four templates in the 5 × 5 filtering window. And the judgement condition is that except for the central pixel, there are at least two noise-free pixels or second restored pixels on each direction template. In other words, only if all the direction filtering template meet the condition, the optimal direction template can be selected from the four templates in the 5 × 5 filtering window. Otherwise, the size of filtering window need to be further enlarged as shown in the final step. From the previous step, it is known that the pixels P1, P2, P3, P4 are noise-free pixels or second restored pixels. Therefore, the characteristics of other pixels P6, P7, P8, P9, P10, P11, P12, P13 will be identified. And the first direction template as shown in Fig 3(B) is taken as an example to introduce the judgement process of pixels on the direction template as follows:
- The pixel P9 is firstly identified whether it is a noise-free pixel. If it is a noise-free pixel, pixel P1 and pixel P9 will be selected as the pixels on the direction template. Instead, if it is a noise corrupted pixel, the characteristic of pixel P13 will be judged.
- If the pixel P13 is a noise-free pixel, pixel P1 and pixel P13 will be selected as the pixels on the direction template. Otherwise, if it is a noise corrupted pixel, the size of filtering window need to be further enlarged to be 7 × 7.
After judging the first direction template, the other three direction templates shown in Fig 3(B) will be judged that whether they can meet the condition. For all the four direction templates, if no need to enlarge the size of filtering window appears, the filtering window of size 5 × 5 can be used to restore the gray level of the central noise corrupted pixel. And similar to the step 1, the same selection process for the optimal direction template will be performed. Similarly, in this step two pixels are selected to restore the gray level of the central pixel. And according to the same calculated process as the step 1, the gray level of the central pixel will be replaced by the mean gray level of the selected pixels on the optimal direction template. Instead, if the optimal direction template cannot be selected from the four direction templates in the 5 × 5 filtering window, the final step will be performed.
Step 3: Further enlarge the size of filtering window to be 7 × 7 and design four direction templates as shown in Fig 4.
From Fig 4, it can be seen that there are more pixels in every direction template in the 7 × 7 filtering window than the above two filtering windows. Hence, the filtering window will not be further enlarged up to now and the optimal direction template will be selected from the four direction templates as follows:
- Identify all the noise-free and second corrected pixels on every direction template El.
- For each direction template El, identify all the noise-free pixels and second restored pixels and then select the pixel with the maximum gray level
and the pixel with the minimum gray level
among all the noise-free pixels and second restored pixels.
- Calculate the absolute gray level difference al of
and
on every direction template as follows:
(9) where l(1 ≤ l ≤ 4) is the direction index.
- Identify the minimum gray level difference
among the four absolute gray level differences by the following formula:
(10)
- Select the direction template with the minimum gray level difference as the optimal one, and denote it as
.
Similar to the above steps, after selecting the optimal direction template the noise-free pixels and the second restored pixels on the optimal direction template are selected to restore the gray level of the central pixel. And the gray level of the central pixel will be replaced by the mean gray level of the selected pixels on the optimal direction template. Then the second restoration gray level of the central pixel is calculated according to the following formula:
(11)
where
denotes the selected pixel on the optimal direction template. The value of n is equal to the number of the selected pixels.
3 Experimental results
In order to demonstrate the effectiveness of the proposed filter, the proposed filter is firstly compared with five representative denoising methods include the switching median (SM) filter [20], the directional weighted median (DWM) filter [26], the modified directional weighted median (MDWM) filter [27], the modified directional weighted (MDW) filter [28] and the three-values-weighted (TVW) filter [30]. Three typical gray level images with different image features include Lena, Boat and Zelda are selected as the test images. The performance of image restoration results is quantitatively evaluated by two measures, namely, PSNR (peak signal-to-noise ratio) [32] and MSSIM (mean structural similarity) [33]. The higher the value of PSNR is, the better the quality of the restored image is. PSNR can be expressed as
(12)
where MAX is the maximum gray level of an image and its value is 255 for a gray level image. The MSE denotes the mean square error between the original noise-free image and the restored image, which can be calculated by
(13)
where si,j and
denote the original pixel and the restored pixel, respectively. M and N are the sizes of an image for the width and the height.
MSSIM reflects the structural similarity between the restored image and the original noise-free image. The higher value of MSSIM means that the structures in the restored image can be preserved more completely. MSSIM is defined as
(14)
where x and y denote the original noise-free image and the restored image, respectively. W is the number of local windows in the image. The SSIM denote the structural similarity between the original noise-free image and the restored image which is given by
(15)
where μx and μy are the means of the input image and the restored image, respectively. σxy is the covariance of the input image and the restored image.
and
are the variances of the input image and the restored image, respectively. C1 and C2 are the constants which can be calculated according to the paper [24].
Table 1 presents the performance comparisons for the different filters in terms of PSNR value for the test images. It can be seen that in the case of low noise corruption (noise density less than 30%), all the filters can perform well. In the case of medium noise corruption, such as 40%-70% noise density, the MDWM, MDW, TVW filters and the proposed filter reveal the superior denoising performance then the SM and DWM filters. As to the cases of heavy noise corruptions (noise density higher than 80%), the TVW filter and the proposed filter achieve the better results than the SM, DWM, MDWM and MDW filters. And compared to other filters, the proposed filter can obtain the higher value of PSNR in the cases of various noise densities. Hence, Table 1 indicates that the proposed filter is able to more effectively remove salt-and-pepper noise than other compared filters.
The performance comparisons for the different filters in terms of MSSIM value for the test images are shown in Table 2. One can observe that the MSSIM values of the restoration results of the SM and DWM filters are significantly less than the MDWM, MDW, TVW filters and the proposed filter in the case of various noise densities. It means that the MDWM, MDW, TVW filters and the proposed filter have stronger capability than the SM and DWM filters for preserving image structures. Besides, in the case of higher noise density, the TVW filter and the proposed filter can achieve the larger values of MSSIM than the MDWM and MDW filters. This indicates that the TVW filter and the proposed filter can preserve image structures better than the MDWM and MDW filters at heavy noise density. In addition, the proposed filter achieves the largest value of MSSIM among the different filters in the case of various noise densities. In other words, the structures in the restoration results of the proposed filter can be preserved more completely than other compared filters.
Tables 3 and 4 present the quantitative comparisons for the various filters in terms of the average PSNR value and the average MSSIM value for the three test images, respectively. According to Table 3, one can observe that the MDWM, MDW, TVW filters and the proposed filter achieve the larger average PSNR value than the SM and DWM filters in the cases of various noise densities. In the heavy noise corruption, the TVW filter and the proposed filter can perform better than the MDWM and MDW filters. And the proposed filter usually obtains the largest average PSNR value. From the quantitative comparisons as shown in Table 4, we can obtain the similar conclusions. Hence, the proposed filter can achieves the larger average values of PSNR and MSSIM than other filters which can indicate that the proposed filter outperforms than the other filters in image denoising and detail preservation.
In order to explore the visual quality of the various filters, we show the restored images in the case of different noise density. Figs 5, 6 and 7 show the restoration results of various filters for the Lena, Boat and Zelda images, respectively. And the test images are corrupted by salt-and-pepper noise with 50% noise density. One can observe that the AM and DWM filters obtain the worst image restoration effect. Although they can remove the salt-and-pepper noise from the corrupted images, they still suffer from the blurred effect for the edges and details in the restored images. The MDWM, MDW, TVW filters and the proposed filter can efficiently remove the noise and be free from the blurred effect in the restored images. Besides, the TVW filter and the proposed filter achieve the better visual effect than other filters, because they can preserve more edges and contain less noise in the restoration images.
(A) Noise-free image. (B) Noise corrupted image. (C) Restoration result of SM filter. (D) Restoration result of DWM filter. (E) Restoration result of MDWM filter. (F) Restoration result of MDW filter. (G) Restoration result of TVW filter. (H) Restoration result of proposed filter.
(A) Noise-free image. (B) Noise corrupted image. (C) Restoration result of SM filter. (D) Restoration result of DWM filter. (E) Restoration result of MDWM filter. (F) Restoration result of MDW filter. (G) Restoration result of TVW filter. (H) Restoration result of proposed filter.
(A) Noise-free image. (B) Noise corrupted image. (C) Restoration result of SM filter. (D) Restoration result of DWM filter. (E) Restoration result of MDWM filter. (F) Restoration result of MDW filter. (G) Restoration result of TVW filter. (H) Restoration result of proposed filter.
Figs 8, 9 and 10 show the restoration results of various filters for the test images which are corrupted by salt-and-pepper noise with 80% noise density. It can be found that the SM and DWM filters fail to restore the heavy noise corrupted image. The restored images of MDWM filter suffer from a great quantity of blurred effects for edges and details. Although the DWM filter can restore image edges and details from the noise corrupted image, plenty of residual noise still exists in the restored images. The TVW filter and the proposed filter can distinguish the contours of the test images, but the TVW filter still has a few white noise and black noise in the restored images. Therefore, the above restoration results clearly indicate that the proposed filter obtains the best visual effect in terms of noise suppression and detail preservation especially when the noise density is high.
(A) Noise-free image. (B) Noise corrupted image. (C) Restoration result of SM filter. (D) Restoration result of DWM filter. (E) Restoration result of MDWM filter. (F) Restoration result of MDW filter. (G) Restoration result of TVW filter. (H) Restoration result of proposed filter.
(A) Noise-free image. (B) Noise corrupted image. (C) Restoration result of SM filter. (D) Restoration result of DWM filter. (E) Restoration result of MDWM filter. (F) Restoration result of MDW filter. (G) Restoration result of TVW filter. (H) Restoration result of proposed filter.
(A) Noise-free image. (B) Noise corrupted image. (C) Restoration result of SM filter. (D) Restoration result of DWM filter. (E) Restoration result of MDWM filter. (F) Restoration result of MDW filter. (G) Restoration result of TVW filter. (H) Restoration result of proposed filter.
The enlarged restoration results of various filters for the details of test images with 50% noise density are shown in Figs 11, 12 and 13, respectively. From Fig 11, one can observe that the details such as the tassels of Lena image, are blurred in the restored results of the SM and DWM filters. The MDWM and MDW can preserve the details, but some residual noise still exists in the restored images. The TVW filter and the proposed filter can preserve the details better than the MDWM and MDW filters. From Figs 12 and 13, the similar conclusions as Fig 11 can be obtained. The enlarged restoration results of various filters for the details of test images with 80% noise density are shown in Figs 14, 15 and 16, respectively. From Fig 14, it can be seen that the details are seriously blurred in the restored results of the SM and DWM filters. Although the details in the restored images of MDWM are blurred, the contours still can be judged from the restored images. The MDW and TVW filters can preserve the details, but some residual noise still exists in the restored images. The proposed filter can preserve the details better than the other filters. The similar conclusions as Fig 14 can be obtained from Figs 15 and 16. All of these results indicate that the proposed filter can obtains the best visual effect in terms of noise suppression and detail preservation in the cases of various noise densities.
(A) Noise-free image. (B) Noise corrupted image. (C) Restoration result of SM filter. (D) Restoration result of DWM filter. (E) Restoration result of MDWM filter. (F) Restoration result of MDW filter. (G) Restoration result of TVW filter. (H) Restoration result of proposed filter.
(A) Noise-free image. (B) Noise corrupted image. (C) Restoration result of SM filter. (D) Restoration result of DWM filter. (E) Restoration result of MDWM filter. (F) Restoration result of MDW filter. (G) Restoration result of TVW filter. (H) Restoration result of proposed filter.
(A) Noise-free image. (B) Noise corrupted image. (C) Restoration result of SM filter. (D) Restoration result of DWM filter. (E) Restoration result of MDWM filter. (F) Restoration result of MDW filter. (G) Restoration result of TVW filter. (H) Restoration result of proposed filter.
(A) Noise-free image. (B) Noise corrupted image. (C) Restoration result of SM filter. (D) Restoration result of DWM filter. (E) Restoration result of MDWM filter. (F) Restoration result of MDW filter. (G) Restoration result of TVW filter. (H) Restoration result of proposed filter.
(A) Noise-free image. (B) Noise corrupted image. (C) Restoration result of SM filter. (D) Restoration result of DWM filter. (E) Restoration result of MDWM filter. (F) Restoration result of MDW filter. (G) Restoration result of TVW filter. (H) Restoration result of proposed filter.
(A) Noise-free image. (B) Noise corrupted image. (C) Restoration result of SM filter. (D) Restoration result of DWM filter. (E) Restoration result of MDWM filter. (F) Restoration result of MDW filter. (G) Restoration result of TVW filter. (H) Restoration result of proposed filter.
In order to further demonstrate the effectiveness of the proposed filter, the proposed filter is compared with some state-of-the-art filters for noise removal as the adaptive weighted mean (AWM) filter [22], the adaptive decision based kriging interpolation (ADKI) filter [23], the adaptive iterative fuzzy (AIF) filter [29] and the adaptive Type-2 fuzzy (ATF) filter [31]. Table 5 presents the performance comparisons for the different filters in terms of PSNR for Lena image. It can be seen that the proposed filter can obtain the higher value of PSNR than AWM filter in the case of different noise density. Compared with the AIF and ATF filters, the proposed filter can achieve the higher value of PSNR in the case of heavy noise corruption (noise density higher than 80%). Although the ADKI filter can obtain the higher value of PSNR than the proposed filter in the case of different noise density, the operating conditions of the ADKI filter are stricter than the proposed filter. Hence, Table 5 shows that the proposed filter can perform better than some state-of-the-art filters.
Table 6 presents the performance comparisons of the proposed filter in error rate for the test images. It can be seen that the error rate of the proposed filter increases with the noise density. However, in the case of low noise corruption (noise density less than 30%), the error rate of the proposed filter does not exceed 30. And in the case of medium noise corruption, such as 40%-70% noise density, the error rate of the proposed filter is less than 65. As to the cases of heavy noise corruptions (noise density higher than 80%), the error rate of the proposed filter is less than 85. Therefore, Table 6 indicates that the proposed filter is able to effectively and accurately detect the salt-and-pepper noise.
4 Conclusion
A new two-stage filter for removing salt-and-pepper noise using noise detector based on characteristic difference parameter and adaptive directional mean filter is proposed in this paper. There are three main contributions of the proposed filter. The first one is that the proposed filter introduces the noise detector based on the characteristic difference parameter and gray level extreme to effectively and accurately identify the noise corrupted pixels. The second one is that the proposed filter introduces a restoration scheme to secondly restore the noise corrupted pixels after primary filtering by two different restoration skills. The third one is that a new adaptive directional mean filter is developed in the restoration scheme which can effectively remove noise in the case of various noise densities meanwhile preserve some important edges and details especially at the high noise density. Experimental results on a series of images with varying noise densities show that the proposed method can perform better than many other existing main filters in terms of image denoising and detail preservation.
Acknowledgments
This work is supported by National Natural Science Foundation of China (No.11471262).
References
- 1. Motta G, Ordentlich E, Ramirez I, Seroussi G, Weinberger MJ. The iDUDE framework for grayscale image denoising. IEEE Trans Image Process. 2011;20(1):1–21. pmid:21172742
- 2. Tian H, Cai H, Lai J. A novel diffusion system for impulse noise removal based on a robust diffusion tensor. Neurocomputing. 2004;133(10):222–230.
- 3. Samuel M, Valentin G, Almanzor S. Adaptive marginal median filter for colour images. Sensors. 2011;11(3):3205–3213.
- 4. Chen T, Wu HR. Space variant median filters for the restoration of impulse noise corrupted images. IEEE Trans Circuits Syst II. 2001;48(8):784–789.
- 5. Chen L, Chen CLP, Lu M. A multiple-kernel fuzzy c-means algorithm for image segmentation. IEEE Trans Syst Man Cybern B: Cybern. 2011;41(5):1263–1274.
- 6. Chen PY, Lien CY. An efficient edge-preserving algorithm for removal of salt-and-pepper noise. IEEE Signal Process Lett. 2008;15:833–836.
- 7. Gui J, Tao D, Sun Z, Luo Y, You X, Tang YY. Group sparse multiview patch alignment framework with view consistency for image classification. IEEE Trans Image Process. 2001;23(7):3126–3137.
- 8. Li H, Wei Y, Li L, Chen CLP. Hierarchical feature extraction with local neural response for image recognition. IEEE Trans Cybern. 2013;43(2):412–424. pmid:22910120
- 9. Xu J, Ren DW, Zang L, Zhang D. Patch group based Bayesian learning for blind image denoising. Asian Conference on Computer Vision. 2016;10116:79–95.
- 10. Zuo WM, Ren DW, Cu SH, Lin L, Zhang L. Discriminative learning of iteation-wise priors for blind deconvolution. IEEE Conferecne on Computer Vision and Pattern Recognition. 2015;3232–3240.
- 11. Ren DW, Zhang HZ, Zhang D, Zuo WM. Fast total-variation based image restoration based on derivative alternated direction optimization methods. Neurocomputing. 2015;170:201–212.
- 12. Deng H, Ren DW, Xian G, Zhang D, Zuo WM. A coordinate descent method for total variation minimization. Mathematical Problems in Engineering. 2017;1–13.
- 13. Huang TS, Yang GJ, Tang GY. Fast two-dimensional median filtering algorithm. IEEE Trans Acoust Speech Signal Process. 1979;27(1):13–18.
- 14. Ko S, Lee Y. Center weighted median filters and their applications to image enhancement. IEEE Trans Circuits Syst. 1991;38(9):984–993.
- 15. Chen T, Wu HR. Adaptive impulse detection using center-weighted median filters. IEEE Signal Process Lett. 2001;8(1):1–3.
- 16. Hwang H, Haddad R. Adaptive median filters: new algorithms and results. IEEE Trans Image Process. 1995;4(4):499–502. pmid:18289998
- 17. Ibrahim H, Kong N, Ng T. Simple adaptive median filter for the removal of impulse noise from highly corrupted images. IEEE Trans Image Process. 2005;54(4):1920–1927.
- 18. Sun T, Neuvo Y. Detail-preserving median based filters in image processing. Pattern Recognit Lett. 1994;15(4):341–347.
- 19. Eng HL, Ma KK. 242-251. Noise adaptive soft-switching median filter for image denoising. IEEE Trans Image Process. 2001;10:242–251. pmid:18249615
- 20. Zhang S, Karim MA. A new impulse detector for switching median filters. IEEE Signal Process Lett. 2002;9(11):360–363.
- 21. Ren DW, Zuo WM, Zhao XF, Lin ZC, Zhang D. Fast gradient vector flow computation based on augmented Lagrangian method. Pattern Recognit Lett. 2013;34:219–225.
- 22. Zhang PX, Li F. A new adaptive weighted mean filter for removing salt-and-pepper noise. IEEE Signal Process Lett. 2014;21(10):1280–1283.
- 23. Varatharajan R, Vasanth K, Gunasekaran M, Priyan M, Gao XZ. An adaptive decision based kriging interpolation algorithm for the removal of high density salt and pepper noise in images. Computers and Electrical Engineering. 2017;000:1–15.
- 24. Esakkirajan S, Veerakumar T, Subramanyam AN, PremChand CH. Removal of high density salt and pepper noise through modified decision based unsymmetric trimmed median filter. IEEE Signal Process Lett. 2001;18(5):287–290.
- 25. Ng P, Ma K. A switching median filter with boundary discriminative noise detection for extremely corrupted images. IEEE Trans Image Process. 2006;15(6):1506–1516. pmid:16764275
- 26. Dong Y, Xu S. A new directional weighted median filter for removal of random-valued impulse noise. IEEE Signal Process Lett. 2007;14(3):193–196.
- 27. Lu C, Chou T. Denoising of salt-and-pepper noise corrupted image using modified directional-weighted-median filter. Pattern Recognit Lett. 2012;33(10):1287–1295.
- 28. Li Z, Liu Y, Xu Y, Cheng Y. Modified directional weighted filter for removal of salt & pepper noise. Pattern Recognit Lett. 2014;40(15):113–120.
- 29. Ahmed F, Das S. Removal of high-density salt-and-pepper noise in images with an iterative adaptive fuzzy filter using alpha-trimmed mean. IEEE Trans on Fuzzy Systems. 2014;22(5):1352–1358.
- 30. Lu C, Chen Y, Wang L, Chang C. Removal of salt-and-pepper noise in corrupted image using three-values-weighted approach with variable-size window. Neurocomputing. 2016;80(1):188–199.
- 31. Singh V, Dev R, Dhar NK, Agrawal P, Verma NK. Adaptive type-2 fuzzy approach for filtering salt and pepper noise in grayscale images. IEEE Trans on Fuzzy Systems. 2018:1–6.
- 32. Chan RH, Ho CW, Nikolova M. Salt and pepper noise removal by median type noise detectors and detail-preserving regularization. IEEE Trans Image Process. 2007;14(10):1479–1485.
- 33. Wang Z, Bovik AC, Sheikh HR, Simoncelli EP. Image quality assessment: from error visibility to structural similarity. IEEE Trans Image Process. 2004;13(4):600–612. pmid:15376593