Skip to Content
SymmetrySymmetry
  • Article
  • Open Access

21 March 2021

Salt and Pepper Noise Removal Method Based on a Detail-Aware Filter

,
and
1
College of Computer Science and Technology, Qilu University of Technology (Shandong Academy of Sciences), Jinan 250023, China
2
Shandong Computer Science Center (National Supercomputing Center in Jinan), Jinan 250101, China
*
Author to whom correspondence should be addressed.
This article belongs to the Section Computer

Abstract

The median-type filter is an effective technique to remove salt and pepper (SAP) noise; however, such a mechanism cannot always effectively remove noise and preserve details due to the local diversity singularity and local non-stationarity. In this paper, a two-step SAP removal method was proposed based on the analysis of the median-type filter errors. In the first step, a median-type filter was used to process the image corrupted by SAP noise. Then, in the second step, a novel-designed adaptive nonlocal bilateral filter is used to weaken the error of the median-type filter. By building histograms of median-type filter errors, we found that the error almost obeys Gaussian–Laplacian mixture distribution statistically. Following this, an improved bilateral filter was proposed to utilize the nonlocal feature and bilateral filter to weaken the median-type filter errors. In the proposed filter, (1) the nonlocal strategy is introduced to improve the bilateral filter, and the intensity similarity is measured between image patches instead pixels; (2) a novel norm based on half-quadratic estimation is used to measure the image patch- spatial proximity and intensity similarity, instead of fixed L1 and L2 norms; (3) besides, the scale parameters, which were used to control the behavior of the half-quadratic norm, were updated based on the local image feature. Experimental results showed that the proposed method performed better compared with the state-of-the-art methods.

1. Introduction

Detail restoration is a challenging problem that is necessary for some image processing tasks, such as feature extraction, object identification, and pattern recognition. The impulse noise remains in the process of image acquisition and transmission [1,2], which is an inevitable and unwanted phenomenon. The salt and pepper (SAP) noise is a type of impulse noise where the corrupted pixel takes either the maximum or minimum gray value. This noise appears as white and black pixels in the corrupted image [3,4,5]. Moreover, the challenge in detail restoration is further amplified when the images are corrupted by heavy SAP noise owing to the significant destruction of information detail.
In this work, a two-step SAP noise removal method is proposed. The aim of this method is to study the denoising result of the median-type filter further, and propose a novel method to improve the visual quality. First, by analyzing the error of the median-type filter, it was observed to adhere to a Gaussian–Laplacian mixture distribution statistically. Following this observation, in the second step, an adaptive nonlocal bilateral filter has been proposed to utilize the nonlocal feature and bilateral filter to recover the result of median-type filters. In the proposed filter, the difference between the image patch is measured by a modified version of the adaptive norm proposed in [6], which is different from the traditional methods. Moreover, the scale parameters, which were used to control the behavior of the adaptive norm, were updated based on the local feature for higher estimation accuracy.
The contributions of this paper are summarized as follows:
(1)
By analyzing the error of the median-type filter statistically, it is found that the error is almost a Gaussian–Laplacian mixture distribution. Therefore, a two-step noise removal method is designed to remove the SAP noise.
(2)
A novel adaptive non-local bilateral filter is proposed to recover the median-type filtered result. Owing to the drawbacks of traditional bilateral filter, a nonlocal operator is used to extract image patches, and the adaptive norm is used to measure the spatial proximity and intensity similarity between the patches.
(3)
We propose a method to calculate the scale parameters in the adaptive norm. Using this strategy, the context information can be utilized to make the norm adapt to the patch feature.

3. Error Analysis and Bilateral Filter

3.1. Error Analysis

In this work, we focused on the statistical characteristics of the results other than the method itself. Based on this idea, we first add salt and pepper noise with various intensities to the image and then remove the noise using the median type filter (i.e., MF, NAFSM)
I ^ m f = M e d i a n F i l t e r ( I )
where I ^ m f denotes the filtered image and I is the image corrupted by the SAP noise. Then, we calculated the error image
I e r r = I ^ m f I o r i
where I e r r is the error image between the filtered image I ^ m f and the original image Iori.
Then, we compute the normalized histogram for the error image. Take the image “Lena” as an example, Figure 1a is the error image between I and the original image Iori, Figure 1b is the histogram for Figure 1a, Figure 1c is the error image between the filtered image I ^ m f and the original image Iori. To verify our hypothesis, we repeated these experiments in different images with different sizes and noise intensities. Furthermore, the histogram of the error of these images is shown in Figure 1d. It can be seen that the curves corresponding to different images are all very close to the red curve (i.e., Gaussian distribution defined in Equation (3)) at both ends, while close to the black curve (i.e., Laplacian distribution defined in Equation (4)) near the peak area. It means that after prefiltering, the noise remained in the image obeys a Gaussian–Laplacian mixture distribution.
Figure 1. Error image and the corresponding histogram. (a) Error image between I and Iori for image “Lena”; (b) histogram of (a); (c) error image between Iori and I ^ m f for the image “Lena”; (d) histograms of the error image for 10 images.
If r obeys Gaussian distribution, i.e., r ~ Ν ( μ G , σ G ) , the distribution function is defined as
ρ G ( r ) = 1 2 π σ G exp ( ( r μ G ) 2 2 σ G 2 )
If t obeys Laplacian distribution, i.e., t ~ L a ( μ L , σ L ) , the distribution function is defined as
ρ L ( t ) = 1 2 σ L exp ( | t μ L | σ L )
where, μ G and μ L are position parameter, σ G and σ L are scale parameters.
Intuitively, we deduce that the image obtained by the median-type filter is similar to an image with mixture noise, which can be written as
I ^ m f = I o r i + n G & L
This phenomenon gives us an inspiration that a better denoising performance would be achieved by successfully designing a Gaussian–Laplacian mixed noise filter and introducing it into a SAP noise removal problem. In this paper, this question will be discussed and satisfactory results are obtained by applying the modified bilateral filter into salt-and-pepper noise removal.

3.2. Bilateral Filter

Bilateral filter [33,34] is a kind of nonlinear filter aimed at edge preservation, since it simultaneously considers spatial proximity and the intensity similarity between image pixels. Mathematically, the corrupted image pixel can be estimated by the weighted average of all the neighborhood pixels as
x ( i , j ) = ( k , l ) B ( i , j ) ω d ( i , j , k , l ) ω r ( i , j , k , l ) I ( k , l ) ( k , l ) B ( i , j ) ω d ( i , j , k , l ) ω r ( i , j , k , l )
where x(i, j) denotes the estimated image pixel located at (i, j), B(i, j) denotes the patch whose center pixel is located at (i, j), I ( k , l ) B ( i , j ) , ω d and ω r are both Gaussian functions to measure the spatial proximity and the intensity similarity, respectively. Formally, these functions can be written as
ω d ( i , j , k , l ) = exp ( ( i k ) 2 + ( j l ) 2 2 σ d 2 )
ω r ( i , j , k , l ) = exp ( I ( i , j ) I ( k , l ) 2 2 2 σ r 2 )
where, σd and σr are smoothing parameters.

4. Proposed Two-Step Algorithm

This section presents a detailed explanation of the proposed two-step SAP noise removal algorithm. In the first step, a median-type filter (i.e., NAFSMF) was used to process the corrupted image. Then, in the second step, a novel-designed adaptive nonlocal bilateral (ANB) filter is used to weaken the error of the median-type filter given that it is found to have a Gaussian-like distribution statistically.

4.1. NAFSMF for Preprocessing

In this stage, the noisy image histogram is utilized so as to estimate the noisy pixels in the image corrupted by SAP noise. The local maximum method [18] is first used to detect the noisy pixels. By using this method, it can avoid mistaking noise free intensities in the noisy image histogram for the noisy intensities in the case of low noise intensity. The local maximum is the first peak encountered when traversing the noisy image histogram in a particular direction. The search is started from both ends of the histogram and directed towards the center of the histogram. Two noise intensities are found and used to identify possible noisy pixels in the image. The two local maximums are denoted as NSalt and NPepper, respectively. A noise mask M is designed as follows to mark the location of noisy pixels
M ( i , j ) = { 0 , I ( i , j ) = N S a l t o r I ( i , j ) = N P e p p e r 1 , o t h e r w i s e
where I(i, j) records the gray value at point (i, j). M(i, j) = 1 denotes that the point (i, j) in I is noise-free; otherwise, M(i, j) = 0 denotes that the point (i, j) in I is a noisy point.
To calculate the noisy point I(i, j), first, define a search window W 2 s + 1 ( i , j ) with size (2s + 1) × (2s + 1)
W 2 s + 1 ( i , j ) = { I ( i + m , j + n ) | m , n ( s , s ) }
Then, T 2 s + 1 ( i , j ) is used to count the number of noise-free pixels in W 2 s + 1 ( i , j )
T 2 s + 1 ( i , j ) = m , n ( s , s ) N ( i + m , j + n )
If T 2 s + 1 ( i , j ) > 1 , the value of the noisy pixel is calculated using
I M e d ( i , j ) = m e d i a n { I ( i + m , j + n ) | M ( i + m , j + n ) = 1 ; m , n ( s , s ) }
If T 2 s + 1 ( i , j ) < t , there is not enough noise-free pixels in the current window. In this case, s + 1 s until T 2 s + 1 ( i , j ) > 1 . Finally, y is used to denote the filtering result and the central pixel y(i, j) is calculated using the equation
y ( i , j ) = ( 1 F ( i , j ) ) I ( i , j ) + F ( i , j ) I M e d ( i , j )
where F(i, j) is a fuzzy membership function that is defined as
F ( i , j ) = { 0 , D ( i , j ) < T 1 D ( i , j ) T 1 T 2 T 1 T 1 < D ( i , j ) < T 2 1 D ( i , j ) > T 2
In Equation (14), D(i, j) represents the local information defined as the maximum gray value difference in a 3 × 3 window, and it is defined as
D ( i , j ) = max { | I ( i + k , j + l ) I ( i , j ) | k , l ( 2 , 2 ) , ( i + k , j + l ) ( i , j ) }

4.2. ANB Filter to Improve Result

The bilateral filter has local characteristics due to considering the pertinence of pixels to estimate noisy pixels. The pertinence will be destroyed when encountering high noise intensity, thus the denoising effect will be greatly reduced. To address this problem, we first introduce the nonlocal strategy to the bilateral filter, and a new function to measure the patch intensity similarity is obtained,
ω ¯ r ( i , j , k , l ) = exp ( y ( p , q ) Θ ( i , j ) y ( r , s ) Θ ( k , l ) Θ ( i , j ) , Θ ( k , l ) Ω ( y ( p , q ) y ( r , s ) ) 2 β )
where, Ω represents the search window, Θ ( i , j ) represents the patch centered by y(i, j), Θ ( k , l ) represents the patch centered by y(k, l), β > 0 is a model parameter.
Suppose the vector v R n , the Lp norm of v is defined as v p = ( i = 1 n | v i | p ) 1 p . For the Gaussian noise and Laplacian noise, L2 norm is an excellent choice. However, the L2 norm is outliers, thus, the L2 norm does not perform as well as the L1 norm in preserving sharp edges. Moreover, when using Equations (7) and (16) based method to deal with the preprocessing result, there still exists some problems, such as, (1) all pixels need to be estimated; (2) all pixels in the search window contribute to the estimation; and (3) fixed L2 norm used in Equation (16) is sensitive to high frequency information, which may blur the image edge. Based on the above analysis, we further modified the spatial proximity-based function and the intensity similarity-based function as
ω ^ d ( i , j , k , l ) = { exp ( ( i k ) 2 + ( j l ) 2 α ) 0
ω ^ r ( i , j , k , l ) = { exp ( y ( p , q ) Θ ( i , j ) y ( r , s ) Θ ( k , l ) Θ ( i , j ) , Θ ( k , l ) Ω φ ( y ( p , q ) y ( r , s ) , a ) β ) 0
where, Ω represents the search window, Θ(i, j) represents the patch centered by y(i, j), Θ(k, l) represents the patch centered by y(k, l), α > 0 and β > 0 are model parameters, φ(t, a) is a measure function defined by φ ( t , a ) = a a 2 + t 2 a 2 with scale parameter a > 0. φ(t, a) has self-adaptability of mimicking L1 and L2 norms, and the parameter a controls the transition from L1 norm to L2 norm. Larger a denotes a larger range of difference values that can be discriminated by the L2 norm. In the two patches, Θ(i, j) and Θ(k, l), the difference y(p, q) − y(r, s) may be variational owing to the location. Thus, using the same a to measure the difference is not an excellent choice. In this work, the parameter a is computed based on the local image feature
a p , q , r , s = 1 ( y ( p , q ) y ( r , s ) ) 2 + ε
where ε > 0, which is used to avoid making the dividend zero. Detail analysis about a p , q , r , s is presented in Section 5.
Thus, by substituting a with Equation (19) in Equation (18), we can obtain new functions for the distance in intensity space
ω ^ r ( i , j , k , l ) = { exp ( y ( p , q ) Θ ( i , j ) y ( r , s ) Θ ( k , l ) ψ ( y ( p , q ) y ( r , s ) , a p , q , r , s ) β ) 0
where ψ ( t , a p , q , r , s ) = a p , q , r , s a p , q , r , s 2 + t 2 a p , q , r , s 2 .
Based on Equations (17) and (20), the ANB filter is proposed and defined as
x ^ ( i , j ) = ( k , l ) Θ ( i , j ) ω ^ d ( i , j , k , l ) ω ^ r ( i , j , k , l ) y ( k , l ) ( k , l ) Θ ( i , j ) ω ^ d ( i , j , k , l ) ω ^ r ( i , j , k , l )
In the following section, we will discuss the advantages of the adaptive norm compared with L1 and L2 norms in theory. The experimental comparisons are also shown in Section 6.

4.3. Proposed Two-Stage Noise Removal Algorithm

In this subsection, we summarized the whole salt and pepper noise removal algorithm. The whole algorithm contains two stages: (1) median-type filter and (2) the proposed ANB filter. The proposed algorithm is described as Algorithm 1:
Algorithm 1: Proposed two-stage noise removal algorithm
Input: noisy image I, α, β;
First stage
 1. Obtain M using Equation (9);
 2. 1 s
  Obtain W 2 s + 1 ( i , j ) and T 2 s + 1 ( i , j ) ;
  Do s s + 1 until T 2 s + 1 ( i , j ) > 1 ;
 3. Calculate I M e d ( i , j ) = m e d i a n { I ( i + m , j + n ) | m , n ( s , , 0 , s ) } ;
 4. Calculate y = ( 1 F ( i , j ) ) I ( i , j ) + F ( i , j ) I M e d ( i , j ) using Equations (14) and (15);
Second stage
 5. Calculate the spatial proximity using
ω ^ d ( i , j , k , l ) = { exp ( ( i k ) 2 + ( j l ) 2 α ) 0
 6. Calculate the scale parameters using
a p , q , r , s = 1 ( y ( p , q ) y ( r , s ) ) 2 + ε
 7. Calculate the intensity similarity using
ω ^ r ( i , j , k , l ) = { exp ( y ( p , q ) Θ ( i , j ) y ( r , s ) Θ ( k , l ) ψ ( y ( p , q ) y ( r , s ) , a p , q , r , s ) β ) 0
 8. Obtain the de-noised result
x ( i , j ) = ( k , l ) Θ ( i , j ) ω ^ d ( i , j , k , l ) ω ^ r ( i , j , k , l ) y ( k , l ) ( k , l ) Θ ( i , j ) ω ^ d ( i , j , k , l ) ω ^ r ( i , j , k , l )
Output: de-noised image x

5. Efficiency Analysis

One of the main contributions of this manuscript is the establishment of the ANB filter, which is based on the improved functions ( ω ^ d and ω ^ r ) with regard to the spatial proximity and the intensity similarity, respectively. The efficiency analysis mainly includes three aspects: (1) the error analysis, which provides an explanation to add the following ANB step; (2) the weight analysis, which shows the efficiency of the introduction of ω ^ d and ω ^ r into the ANB filter; and (3) the norm choice analysis, which presents the efficiency of using the adaptive norm to improve ω ^ r . The error analysis has been presented detailed in Section 2, thus, in this section, the efficiency analysis mainly includes two parts: weight analysis and norm choice.

5.1. Weight Analysis

Two improved weight functions were designed in the proposed filter. The two functions were based on spatial proximity and intensity similarity. The efficiency of using the two weights ω ^ d and ω ^ r was analyzed in three special situations as follows:
Case 1: Considering Equations (17) and (20), if the contributed pixel y(k, l) is corrupted, ω ^ d = ( i , j , k , l ) = 0 and ω ^ r = ( i , j , k , l ) = 0 . To this end, the pixel y(k, l) has no effect on estimating y(i, j). This design can avoid misestimation owing to the corrupted points.
Case 2: If the contributed pixel y(k, l) is noise-free in the smooth region, but y(i, j) in an area where the gray value changes dramatically (i.e., edge region), the difference between the two pixels is large. Correspondingly, the difference between the patches centered by y(k, l) and y(i, j) may be large. In this case, the variable ω ^ r is close to 0, and the value of ω ^ d is small. Thus, it is a double insurance to keep the weight of y(k, l) is small enough when computing for y(i, j).
Case 3: If both y(k, l) and y(i, j) are in the smooth region, a small difference is shown among the image pixels. In this situation, the difference between the patches tends to be 0 infinitely. Thus, the weight ω ^ r approaches 1, and only the weight ω ^ d works. Here, the proposed filter works as a Gaussian filter.

5.2. Norm Choice

The proposed norm ψ ( t , a p , q , r , s ) = a p , q , r , s a p , q , r , s 2 + t 2 a p , q , r , s 2 tends to utilize the advantages of L1 norm and L2 norm, and it has a good adaptivity to the local information by avoiding to set the threshold value to control the selection of the norm compared with other estimators (i.e., the Huber norm, the Leclerc norm, and the Lorentzian norm).
From Equation (19), it is noted that when the difference between y(p, q) and y(r, s) is small, the value of ap,q,r,s is large. Here, the modified adaptive norm contains a range where it performs similar to the L2 norm as large as possible. Conversely, ap,q,r,s is small, and the modified adaptive norm performs similar to the L1 norm, which can remove noise and preserve edges. Thus, the proposed adaptive norm can work as L1 norm or L2 norm automatically according to the local features.
In the following equation,
ψ ( t ) = a p , q , r , s a p , q , r , s 2 + t 2 a p , q , r , s 2 .
where ap,q,r,s is used to control the scope of the linear behavior as shown in Figure 2. This norm is shown in Figure 2 with different ap,q,r,s-values where it can be seen that the adaptive norm gets closer to the L1 norm when the sale parameter tends to zero. Specifically, larger sale parameter results in a larger range of error values that can be discriminated by the linear influence function. Moreover, in ψ ( t ) , the sale parameter controls the transition from L1 norm to L2 norm.
Figure 2. Curve of ψ ( t ) with different a values.
In ω r ( i , j , k , l ) , Equation (8), L2 norm was used to measure the difference between the point y(i, j) and y(k, l). Theoretically, when the difference is large, the weight of y(k, l) is correspondingly small, which means that y(k, l) has little impact on the estimation of y(i, j). Meanwhile, when the difference is very small, especially close to 0, y(k, l) is similar to y(i, j). Here, the L2 norm can enlarge the weight of y(k, l), which increases its contribution to y(i, j). Sometimes, the expected effect may not be achieved using the L2 norm.
The intensity difference in the smooth region tending to be zero is an ideal condition; thus, using the L2 norm to control the weight based on the intensity similarity is not an optimal choice. A simple example is shown in Figure 3 where the region in the red block is an almost smooth area, which is noted as region A. Assuming that y ( i , j ) A , y ( k , l ) A , y(i, j) is a corrupted pixel, and y(k, l) is uncorrupted. Intuitively, y(k, l) should make a large contribution for estimating y(i, j), namely, ω ( i , j , k , l ) 1 , where y(i, j) is the center value of region P1 and y(k, l) is the center value of region P2. However, in the real situation, this assumption could not be achieved because the L2 norm will sharpen the difference. However, the adaptive norm would have a good performance. The analysis is discussed as follows.
Figure 3. Simple example.
Let ω ^ r a d a p t i v e and ω ^ r L 2 denote the Gaussian functions to measure the intensity similarity based on the adaptive norm and L2 norm. Formally, they can be presented as
ω ^ r a d a p t i v e ( i , j , k , l ) = exp ( y ( p , q ) P 1 y ( r , s ) P 2 ψ ( y ( p , q ) y ( r , s ) , a p , q , r , s ) β )
ω ^ r L 2 ( i , j , k , l ) = exp ( y ( p , q ) P 1 y ( r , s ) P 2 ( y ( p , q ) y ( r , s ) ) 2 β )
From these expressions, the difference measurement part of the two formulas is ( ψ ( y ( p , q ) y ( r , s ) , a p , q , r , s ) and ( y ( p , q ) y ( r , s ) ) 2 ). Here, we need to prove that ψ ( y ( p , q ) y ( r , s ) , a p , q , r , s ) < ( y ( p , q ) y ( r , s ) ) 2 with the same σr. For convenience, denote y ( p , q ) y ( r , s ) = t , such that
g ( t ) = a p , q , r , s a p , q , r , s 2 + t 2 a p , q , r , s 2 t 2 = a p , q , r , s 2 + t 2 ( a p , q , r , s a p , q , r , s 2 + t 2 )
Obviously, g(t) < 0, ω ^ r a d a p t i v e ( i , j , k , l ) > ω ^ r L 2 ( i , j , k , l ) . Specifically, using the L2 norm to measure the difference will weaken the contribution of y(k, l), which is contrary to the proposed norm.

6. Experimental Results and Discussion

To evaluate the proposed algorithm, several simulation experiments were performed in this section to compare with many state-of-the-art methods. The noisy images are generated by adding salt and pepper noise with nine different intensities from σ = 10% to σ = 90% to the test images shown in Figure 4, which presents gray-scaled image with sizes between 256 × 256 and 512 × 512. Denoising performance was measured by many subjective and objective standards. The subjective standard included reconstructed images and the corresponding error images. The objective standard included image enhancement factor (IEF) [35], structure similarity index (SSIM) [36], and peak signal-to-noise ratio (PSNR) to evaluate the performance of the proposed method.
Figure 4. Twelve test images. (a) Cameraman; (b)Barbara; (c) Couple; (d) Dog; (e) Lena; (f) Man-made; (g) Pepper; (h) Zebra; (i)Baboon; (j) Street; (k) Boat; (l) Man.
In this work, we first compared the proposed method using the adaptive norm with L1 norm- and L2 norm-based methods. Then, we compared the proposed method with eight previous works, including the median filter (MF), adaptive center weighted median filter (ACWMF, 2001) [37], NAFSMF (2010) [16], an edge-preserving approach based on adaptive fuzzy switching median filter (NASEPF, 2011) [38], INLM (2016) [31], different applied median filter (DAMF, 2018) [39], decision-based algorithm (DBA, 2011) [40] and adaptive type-2 fuzzy approach for salt-and-pepper noise (FSAP, 2018) [41].
In the proposed method, the related parameters are set as follows: T1 = 10, T2 = 30, α = 50×noise intensity, β = 50× noise intensity, the similar patch size is 3 × 3, and the searching window size is 7 × 7. For the other methods, the parameters are set for the best performance. All codes were running in MATLAB 2015b using an i7-7500U CPU, 16 GB RAM computer under Microsoft Windows 10 operation system. For each comparison method, all parameters were selected under the declarations in their papers.

6.1. Comparison under Different Norm Choice

We will take Barbara and Man-made images shown in Figure 4 as examples to compare our proposed method with the L1-based method and L2-based method. The main difference between these three methods is the norm used to measure the intensity similarity in the second stage.
Table 1, Table 2 and Table 3 show the PSNR value, SSIM value, and IEF value, respectively. According to the results in Table 1, Table 2 and Table 3, the proposed method outperformed the other two methods in most cases, especially in high-intensity noise. For example, the proposed method performs better than the L1-based method (average PSNR(dB): 0.68, 0.66, and 0.12; average SSIM: 0.0151, 0.0178, and 0.0099; average IEF: 10.93, 5.85, and 1.09) in the case of σ = 70 % , σ = 80 % , and σ = 90 % , respectively. Moreover, the proposed method performs better than the L2-based method (average PSNR(dB): 0.69, 1.1, and 1.1; average SSIM: 0.0029, 0.0132, and 0.0172; average IEF: 6.65, 13.74, and 13.14) in the case of σ = 70 % , σ = 80 % , and σ = 90 % , respectively. The L1-based method has the advantage in edge preserving. However, the detail region would be over-smooth. The L2-based method can remove noise effectively, while it always makes the edges blur. The proposed method is based on an adaptive norm which has self-adaptability of mimicking L1 and L2 norms. Thus, our method can balance the noise removal and detail protection, even in high-intensity noise.
Table 1. PSNR comparison for our proposed method, L1-based method, and L2-based method with the noise intensity varied from 10% to 90%.
Table 2. SSIM comparison for our proposed method, L1-based method, and L2-based method with the noise intensity varied from 10% to 90%.
Table 3. IEF comparison for our proposed method, L1-based method, and L2-based method with the noise intensity varied from 10% to 90%.

6.2. Comparisons between Pre- and Post-Processed Images

In this sub-section, we would like to show the proposed method effectively reducing the error for a preprocessed image. Figure 5 shows three examples based on Couple, Pepper, and Street images. For better comparisons, we show the error images and the enlarged detail parts. From Figure 5, we can see that the post-processed images have more acceptable details and less error. Besides, the corresponding PSNR, SSIM, and IEF values are presented in Table 4, Table 5 and Table 6.
Figure 5. Comparisons of the pre- and post-processed images. In each line, the left part is the original image, the middle part is the zoomed details. The pre-processed marked “1”, the post-processed marked “2”. The right part is the corresponding error images, the first one is pre-processed error, the second one is post-processed error.
Table 4. PSNR Comparisons between pre- and post-processed images.
Table 5. SSIM Comparisons between pre- and post-processed images.
Table 6. IEF Comparisons between pre- and post-processed images.
According to these tales, it can be seen that the post-processed images achieves higher PSNR, SSIM, and IEF values. For example, the post-processed images gains higher values than the pre-processed images (average PSNR(dB): 1.41, 1.68, and 2.72; average SSIM: 0.0320, 0.0432, and 0.1031; average IEF: 36.47, 33.46, and 37.94) in the case of σ = 70 % , σ = 80 % , and σ = 90 % , respectively. This indicates that the proposed method could further reduce the error in the preprocessed images. That is because in the proposed two-stage method a novel bilateral filter is used to weaken the median-type filter errors is effective.

6.3. Subjective Quality Analysis

In this sub-section, three evaluation measures (i.e., PSNR, IEF, and SSIM) were presented to validate the perception-based image quality assessment on different images under different noise levels. We compared the proposed adaptive method with DBA, MF, ACWMF, NASFM, NASEPF, INLM, DAMF, and FSAP. For far comparison, all parameters in each algorithm are under their statements in published papers.
The graphs of IEF for different images with noise levels varying from σ = 10–90% are shown in Figure 6. For the subfigures in Figure 6, x-axis means σ = 10–90% from left to right. The y-axis denotes the IEF value. This figure confirmed that the proposed method obtained better results compared with other considered methods in terms of higher IEF value. Table 7 shows the PSNR values on the restored images corresponding to eight test images, including those shown in Figure 4 with the noise intensity changes from 10% to 90% as well as Table 8 shows the corresponding SSIM values on the restored images. For better comparisons, we have colored the best values into red.
Figure 6. Comparison of different methods. From top left to right down: the curves of IEF vs. noise intensity achieved for the images Baboon, Pepper, Man-made, Lena, Couple, Cameraman, Barbara, Street.
Table 7. Comparison of PSNR values for test images under different noise intensities.
Table 8. Comparison of SSIM values for test images under different noise intensities.
From these tables, we can see that our proposed method gets the highest PSNR and SSIM values both in the low noise intensity and high noise intensity, which demonstrates the efficiency and necessity of incorporating a novel bilateral filter to weaken the median-type filter errors. In the case of low noise intensity, taking σ = 10% as an example, all the methods achieve high PSNR and SSIM values. The PSNR and SSIM values achieved by different methods are shown in the following: MF (22.01 dB, 0.7025), ACWMF (31.20 dB, 0.9524), DBA (35.09 dB, 0.9828), NAFSM (36.71 dB, 0.9807), NASEPF (27.25 dB, 0.8077), INLM (30.52 dB, 0.8750), DAMF (36.93 dB, 0.9850), FSAP (35.56 dB, 0.9831), and OURS (38.15 dB, 0.9865). We can see that in the case of σ = 10%, the PSNR value of the proposed method (38.15 dB) has outperformed that of the MF method, the ACWMF method, the DBA method, the DAMF method, and the FSAP method more than 1.2. Even in the case of σ = 90% (correspondingly a strong noise), the PSNR value of the proposed method (22.81 dB) has outperformed the PSNR values of the MF method, the ACWMF method, the DBA method, the DAMF method, and the FSAP method more than 1.4. In addition, the proposed method also achieves slightly better reconstruction performance than the INLM method (22.27 dB). Compared with the INLM, a novel bilateral filter is proposed in this work, which is more efficient to suppress the Gaussian–Laplacian errors.

6.4. Objective Quality Analysis

This section presents the visual results obtained by different methods. We evaluated the performance of the proposed method and the methods under comparison via reconstructed images and the corresponding error images, which showed that the error image presented the difference between the original image and the reconstructed image. In the error image, the white point was the error between the de-noised image and the original image. The whiter point denotes the larger difference.
The subjective analysis of the proposed method against the existing methods with different noise intensities were shown in Figure 7, Figure 8, Figure 9 and Figure 10. In these figures, the proposed method was performed in different texture types of images under σ = 60%, 70%, 80%, and 90%.
Figure 7. Results of different algorithms for Barbara image with 60% noise intensity. The subfigures in rounded rectangle are corresponding to original image, MF, ACWMF, DBA, NAFSM, NASEPF, INLM, DAMF, FSAP, and our proposed method, respectively.
Figure 8. Results of different algorithms for Cameraman image with 70% noise intensity. The subfigures in the first line from left to right are corresponding to original image, MF, ACWMF, DBA, and NAFSM, respectively. The subfigures in the third line from left to right are NASEPF, INLM, DAMF, FSAP, and our proposed method, respectively.
Figure 9. Results of different algorithms for Man-made image with 80% noise intensity. The first and third lines are original image, MF, ACWMF, DBA, NAFSM, NASEPF, INLM, DAMF, FSAP, and our proposed method. The second and fourth lines are noise image and corresponding error images.
Figure 10. Results of different algorithms for Lena image with 90% noise intensity. The first and third lines are original image, MF, ACWMF, DBA, NAFSM, NASEPF, INLM, DAMF, FSAP, and our proposed method. The second and fourth lines are noise image and corresponding error images.
To explore the visual quality of different methods, we showed the reconstructed images with different noise densities. Figure 7 and Figure 8 show the restoration results of various methods for the test images, which were corrupted by salt and pepper noise with 60% and 70% noise density, respectively. The MF and ACWMF were also found to fail in restoring the corrupted image. In the reconstructions obtained by DBA and NAFSM, many artifacts exist, which make the contours of the estimated images indistinguishable. The DBA, NAFSM, INLM, DAMF, and FSAP can restore the image with better quality. However, the error noise still exists in the reconstructions. Therefore, the results indicated that the proposed method can preserve details better than other methods.
Figure 9 and Figure 10 show the restoration results of different methods for images that were corrupted by heavy salt and pepper noise with 80% and 90% noise density, respectively. In these figures, the first and third rows were the original images and reconstructed images, respectively. The second and fourth rows were the noised image and corresponding error images, respectively. The SM and DWM filters failed to restore images corrupted by the heavy noise. The visual perception of the reconstructions obtained by MDWM filter was bad because some obvious white and black pixels still exist in the restored images.
Figure 7, Figure 8, Figure 9 and Figure 10 show that the proposed method achieved better visual quality. Our proposed method can preserve texture regions or edge regions by adaptively calculating the nonlocal region features and estimate the original pixel value. Thereby, the proposed method reduces reconstruction error as far as possible. Moreover, in the existing methods, undesirable artificial artifacts were inevitably produced in the reconstructed images. As we expected, satisfactory visual effects obtained by our developed algorithm were more natural and have fewer artifacts, especially in high noise intensities.

6.5. Effect of Searching Window

In this subsection, we will explore the denoising effect of the proposed method under several searching windows with different size, including 7 × 7, 11 × 11, 15 × 15, and 21 × 21. We take four images as test images, in which two 256 × 256 (i.e., Dog and Zebra images) and two 512 × 512 images (i.e., boat and Man images), and nine noise levels from σ = 10–90% are used to generate synthetic noising images. Table 9 presents the average PSNR and SSIM values of the test images under the contribution of different searching windows. In addition to these two quality metrics, another important aspect is the testing speed. Figure 11 shows the average run times of the proposed method with different searching windows for denoising images with 10 noise levels.
Table 9. Comparison of average PSNR/SSIM values for the test images with four search window sizes (SWS) and nine noise intensities.
Figure 11. Average running time comparison based on different search window sizes for (a) 512 × 512 images and (b) 256 × 256 images. The provided values of search window size are 7 × 7, 11 × 11, 15 × 15, and 21 × 21.
From Figure 11 and Table 9, we can see that the methods based on searching windows with 7 × 7 and 11 × 11 have high speed. With the noise intensity increases, the speed is lower. Compare with the methods based on searching windows with 7 × 7, 11 × 11, 15 × 15, respectively, the method based on 21 × 21 window does not achieve obvious higher PSNR and SSIM values. Although more pixels contribute to the estimation, not all pixels are beneficial to restore the corrupted pixels. Moreover, its speed is fairly slow due to the use of more pixels than other windows. Take the 256 × 256 images for example, the average running time, PSNR and SSIM values achieved corresponding to σ = 10% and searching windows with 7 × 7, 11 × 11, 15 × 15, 21 × 21 respectively are shown in the following: method based on 7 × 7 window (10 s, 30.26 db, 0.9681), method based on 11 × 11 window (26 s, 29.27 db, 0.9682), method based on 15 × 15 window (48 s, 30.17 db, 0.9686), method based on 21 × 12 window (92 s, 30.36 db, 0.9684). In the case of σ = 90%, the average running time, PSNR and SSIM values achieved by different methods are shown in the following: method based on 7 × 7 window (77 s, 18.64 db, 0.5687), method based on 11 × 11 window (187 s, 18.68 db, 0.5557), method based on 15 × 15 window (346 s, 18.67 db, 0.5489), method based on 21 × 12 window (684 s, 18.66 db, 0.5440). Therefore, the searching window with 11 × 11 gains the best performance among all the cases when all of these factors are considered together.

7. Conclusions

This paper presented an adaptive nonlocal bilateral filter for salt and pepper noise removal. First, the NAFSM filter was introduced to distinguish the noisy and noise-free pixels and then conduct preliminary filtering on the noisy pixels. Second, an adaptive norm with scale parameters calculated based on local feature was designed to measure the intensity difference between image patches. Finally, the nonlocal thought, the bilateral thought, and the adaptive norm were combined. Then an adaptive nonlocal bilateral filter was designed to suppress the Gaussian–Laplacian mixture noise and further improve the reconstruction quality.
In Section 6, we demonstrate the benefit of our proposed method on the salt and pepper noise removal problem. We first conduct experiments to verify the effectiveness of the adaptive norm adopted in the novel bilateral filter. We have observed that adaptive norm gives comparable or better results compared to the L1 norm and L2 norm. Then, we demonstrate that the proposed bilateral filter could effectively weaken the median-type filter errors. Especially for the high noisy intensity (σ = 90%), the proposed bilateral filter can obtain satisfactory results. We demonstrate the capability of our proposed method with some state-of-art methods with different noise intensities from σ = 10% to σ = 90%. Numerical results illustrated that the proposed method outperformed the state-of-art methods with better visual quality and higher quality metric values. It indicates the effectiveness of our method to use a two-step framework based on the novel-designed adaptive nonlocal bilateral (ANB) filter. Finally, in order to explore the denoising effect of the proposed method under different searching windows, we also compare the denoising results with different window sizes, including 7 × 7, 11 × 11, 15 × 15, and 21 × 21. Comprehensively considering the running time, PSNR and SSIM values, the searching window with 11 × 11 is proven to be a better choice.

Author Contributions

Data curation, H.L.; Formal analysis, S.Z.; Funding acquisition, H.L., N.L., and S.Z.; Methodology, H.L. and S.Z.; Writing—original draft, H.L.; Writing—review & editing, H.L., N.L., and S.Z. All authors have read and agreed to the published version of the manuscript.

Funding

National Natural Science Foundation of China: 61802213; Shandong Provincial Natural Science Found: ZR2020MF039; National Key Research and Development Project: 2019YFB1404701; The Major Science and Technology Innovation Projects of Key R&D Programs of Shandong Province in 2019 (Development and Industrialization of Pathological Artifificial Intelligence Application Software): 2019JZZY010108; Qilu University of Technology (Shandong Academy of Sciences) Young doctor Cooperation Fund Project: 2019BSHZ009.

Institutional Review Board Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Yuan, G.; Ghanem, B. TV: A Sparse Optimization Method for Impulse Noise Image Restoration. IEEE Trans. Pattern Anal. Mach. Intell. 2019, 41, 352–364. [Google Scholar] [CrossRef]
  2. Jin, L.; Zhu, Z.; Song, E.; Xu, X. An Effective Vector Filter for Impulse Noise Reduction Based on Adaptive Quaternion Color Distance Mechanism. Signal Process. 2019, 155, 334–345. [Google Scholar] [CrossRef]
  3. Veerakumar, T.; Subudhi, B.N.; Esakkirajan, S.; Pradhan, P.K. Iterative Adaptive Unsymmetric Trimmed Shock Filter for High-density Salt-and-pepper Noise Removal. Circuits Syst. Signal Process. 2019, 38, 2630–2652. [Google Scholar] [CrossRef]
  4. Fu, B.; Zhao, X.; Song, C.; Li, X.; Wang, X. A Salt and Pepper Noise Image Denoising Method Based on the Generative Classification. Multimed. Tools Appl. 2019, 78, 12043–12053. [Google Scholar] [CrossRef]
  5. Chen, F.; Huang, M.; Ma, Z.; Li, Y.; Huang, Q. An Iterative Weighted-Mean Filter for Removal of High-Density Salt-and-Pepper Noise. Symmetry 2020, 12, 1990. [Google Scholar] [CrossRef]
  6. Zeng, X.; Yang, L. A Robust Multiframe Super-resolution Algorithm Based on Half-quadratic Estimation with Modified BTV Regularization. Digit. Signal Process. Rev. J. 2013, 23, 98–109. [Google Scholar] [CrossRef]
  7. Zhang, X.-M.; Kang, Q.; Cheng, J.-F.; Wang, X. Adaptive Four-dot Median Filter for Removing 1–99% Densities of Salt and-pepper Noise in Images. J. Inf. Technol. Res. 2018, 11, 47–61. [Google Scholar] [CrossRef]
  8. Rhee, K.H. Improvement Feature Vector: Autoregressive Model of Median Filter Error. IEEE Access 2019, 7, 77524–77540. [Google Scholar] [CrossRef]
  9. Storath, M.; Weinmann, A. Fast Median Filtering for Phase or Orientation Data. IEEE Trans. Pattern Anal. Mach. Intell. 2018, 40, 639–652. [Google Scholar] [CrossRef]
  10. Gao, H.; Hu, M.; Gao, T.; Cheng, R. Robust Detection of Median Filtering Based on Combined Features of Difference Image. Signal Process. Image Commun. 2019, 72, 126–133. [Google Scholar] [CrossRef]
  11. Zhang, Z.; Han, D.; Dezert, J.; Yang, Y. A New Adaptive Switching Median Filter for Impulse Noise Reduction with Pre-detection Based on Evidential Reasoning. Signal Process. 2018, 147, 173–189. [Google Scholar] [CrossRef]
  12. Zhu, Z.; Jin, L.; Song, E.; Hung, C.-C. Quaternion Switching Vector Median Filter Based on Local Reachability Density. IEEE Signal Process. Lett. 2018, 25, 843–847. [Google Scholar] [CrossRef]
  13. Chanu, P.R.; Singh, K.M. A Two-stage Switching Vector Median Filter Based on Quaternion for Removing Impulse Noise in Color Images. Multimed. Tools Appl. 2019, 78, 15375–15401. [Google Scholar] [CrossRef]
  14. Sanaee, P.; Moallem, P.; Razzazi, F. An Interpolation Filter Based on Natural Neighbor Galerkin Method for Salt and Pepper Noise Restoration with Adaptive Size Local Filtering Window. Signal Image Video Process. 2019, 13, 895–903. [Google Scholar] [CrossRef]
  15. Varatharajan, R.; Vasanth, K.; Gunasekaran, M.; Priyan, M.; Gao, X.Z. An Adaptive Decision Based Kriging Interpolation Algorithm for the Removal of High Density Salt and Pepper Noise in Images. Comput. Electr. Eng. 2018, 70, 447–461. [Google Scholar] [CrossRef]
  16. Toh, K.K.V.; Isa, N.A.M. Noise Adaptive Fuzzy Switching Median Filter for Salt-and-pepper Noise Reduction. IEEE Signal Process. Lett. 2010, 17, 281–284. [Google Scholar] [CrossRef]
  17. Ibrahim, H.; Kong, N.S.P.; Foo, T.F. Simple Adaptive Median Filter for the Removal of Impulse Noise from Highly Corrupted Images. IEEE Trans. Consum. Electron. 2008, 54, 1920–1927. [Google Scholar] [CrossRef]
  18. Toh, K.K.V.; Ibrahim, H.; Mahyuddin, M.N. Salt-and-pepper Noise Detection and Reduction Using Fuzzy Switching Median Filter. IEEE Trans. Consum. Electron. 2008, 54, 1956–1961. [Google Scholar] [CrossRef]
  19. Wang, Y.; Wang, J.; Song, X.; Han, L. An Efficient Adaptive Fuzzy Switching Weighted Mean Filter for Salt-and-pepper Noise Removal. IEEE Signal Process. Lett. 2016, 23, 1582–1586. [Google Scholar] [CrossRef]
  20. Kumar, S.V.; Nagaraju, C. T2FCS Filter: Type 2 Fuzzy and Cuckoo Search-based Filter Design for Image Restoration. J. Vis. Commun. Image Represent. 2019, 58, 619–641. [Google Scholar] [CrossRef]
  21. González-Hidalgo, M.; Massanet, S.; Mir, A.; Ruiz-Aguilera, D. Improving Salt and Pepper Noise Removal Using a Fuzzy Mathematical Morphology-based Filter. Appl. Soft Comput. J. 2018, 63, 167–180. [Google Scholar] [CrossRef]
  22. Khosravy, M.; Gupta, N.; Marina, N.; Sethi, I.K.; Asharif, M.R. Morphological Filters: An Inspiration from Natural Geometrical Erosion and Dilation. In Nature Inspired Compututer Optimization; Springer: Cham, Switzerland, 2017; pp. 349–379. [Google Scholar]
  23. Sedaaghi, M.H.; Daj, R.; Khosravi, M. Mediated Morphological Filters. In Proceedings of the 2001 International Conference on Image Processing, Thessaloniki, Greece, 7–10 October 2001; 2001; pp. 692–695. [Google Scholar]
  24. Khosravi, M.; Sedaaghi, M.H. Impulsive Noise Suppression of Electrocardiogram Signals with Mediated Morphological Filters. In Proceedings of the 11th Iranian Conference on Biomedical Engineering, Teheran, Iran, 18 February 2004. [Google Scholar]
  25. Khosravy, M.; Asharif, M.R.; Sedaaghi, M.H. Morphological Adult and Fetal ECG Preprocessing: Employing Mediated Morphology. IEICE Med. Imaging 2007, 107, 363–369. [Google Scholar]
  26. Khosravy, M.; Asharif, M.R.; Sedaaghi, M.H. Medical Image Noise Suppression: Using Mediated Morphology. IEICE Tech. Rep. 2008, 107, 265–270. [Google Scholar]
  27. Mafi, M.; Rajaei, H.; Cabrerizo, M.; Malek, A. A Robust Edge Detection Approach in the Presence of High Impulse Noise Intensity through Switching Adaptive Median and Fixed Weighted Mean Filtering. IEEE Trans. Image Process. 2018, 27, 5475–5490. [Google Scholar] [CrossRef]
  28. Balasubramanian, S.; Kalishwaran, S.; Muthuraj, R.; Ebenezer, D.; Jayaraj, V. An Efficient Non-linear Cascade Filtering Algorithm for Removal of High Density Salt and Pepper Noise in Image and Video Sequence. In Proceedings of the IEEE International Conference Control, Automation, Communication and Energy Conservation (INCACEC), Perundurai, Erode, India, 4–6 June 2009; pp. 1–6. [Google Scholar]
  29. Raza, M.T.; Sawant, S. High Density Salt and Pepper Noise Removal through Decision Based Partial Trimmed Global Mean Filter. In Proceedings of the IEEE International Conference Engineering (NUiCONE), Ahmedabad, Gujarat, India, 6–8 December 2012; pp. 1–5. [Google Scholar]
  30. Esakkirajan, S.; Veerakumar, T.; Subramanyam, A.N.; Chand, C.H.P. Removal of High Density Salt and Pepper Noise through Modified Decision Based Unsymmetrical Trimmed Median Filter. IEEE Signal Process. Lett. 2011, 18, 287–290. [Google Scholar] [CrossRef]
  31. Wang, X.; Shen, S.; Shi, G.; Xu, Y.; Zhang, P. Iterative Non-local Means Filter for Salt and Pepper Noise Removal. J. Vis. Commun. Image Represent. 2016, 38, 440–450. [Google Scholar] [CrossRef]
  32. Veerakumar, T.; Subudhi, B.N.; Esakkirajan, S. Empirical Mode Decomposition and Adaptive Bilateral Filter Approach for Impulse Noise Removal. Expert Syst. Appl. 2019, 121, 18–27. [Google Scholar] [CrossRef]
  33. Mafi, M.; Martin, H.; Cabrerizo, M.; Andrian, J.; Barreto, A.; Adjouadi, M. A Comprehensive Survey on Impulse and Gaussian Denoising Filters for Digital Images. Signal Process. 2019, 157, 236–260. [Google Scholar] [CrossRef]
  34. Nair, P.; Chaudhury, K.N. Fast High-dimensional Bilateral and Nonlocal Means Filtering. IEEE Trans. Image Process. 2019, 28, 1470–1481. [Google Scholar] [CrossRef] [PubMed]
  35. Karthikeyan, P.; Vasuki, S. Efficient Decision Based Algorithm for the Removal of High Density Salt and Pepper Noise in Images. J. Commun. Technol. Electron. 2016, 61, 963–970. [Google Scholar] [CrossRef]
  36. Wang, Z.; Bovik, A.C.; Sheikh, H.R.; Simoncelli, E.P. Image Quality Assessment: From Error Visibility to Structural Similarity. IEEE Trans. Image Process. 2004, 13, 600–612. [Google Scholar] [CrossRef] [PubMed]
  37. Chen, T.; Wu, H.R. Adaptive Impulse Detection Using Center Weighted Median Filters. IEEE Signal Process. Lett. 2001, 8, 1–3. [Google Scholar] [CrossRef]
  38. Jiang, D.-S.; Li, X.-B.; Wang, Z.-L.; Liu, C. An Efficient Edge-preserving Approach Based on Adaptive Fuzzy Switching Median Filter. In Proceedings of the 2011 International Conference on Quality, Reliability, Risk, Maintenance, and Safety Engineering, Xi’an, China, 17–19 June 2011; pp. 952–955. [Google Scholar]
  39. Erkan, U.; Gökrem, L.; Enginoğlu, S. Different Applied Median Filter in Salt and Pepper Noise. Comput. Electr. Eng. 2018, 70, 789–798. [Google Scholar] [CrossRef]
  40. Srinivasan, K.S.; Ebenezer, D. A New Fast and Efficient Decision-based Algorithm for Removal of High-density Impulse Noises. IEEE Signal Process. Lett. 2007, 14, 189–192. [Google Scholar] [CrossRef]
  41. Singh, V.; Dev, R.; Dhar, N.K.; Agrawal, P.; Verma, N.K. Adaptive Type-2 Fuzzy Approach for Filtering Salt and Pepper Noise in Grayscale Images. IEEE Trans. Fuzzy Syst. 2018, 26, 3170–3176. [Google Scholar] [CrossRef]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.