1 Introduction

Noise reduction is one of the most frequently performed image processing operations, as the enhancement of degraded images or video streams is crucial for the success of the consecutive image processing steps.

Very often color images are corrupted by various types of noise, introduced by malfunctioning or damaged sensors in the image formation process, poor lighting conditions and aging of the storage material, electronic instabilities of the signal, transmission errors in noisy channels and atmospheric as well as electromagnetic interferences. As a result, images are often corrupted by a mixture of Gaussian and impulsive noise [2, 13, 19, 30, 36, 58].

The suppression of this kind of noise is a challenging task, as filters designed to cope with the Gaussian noise are not able to remove the impulses and the techniques designed for the impulsive noise removal are ineffective in the elimination of the noise modeled by the Gaussian distribution [6, 22, 23, 37, 49, 50].

Fig. 1
figure 1

Illustration of the inability of popular techniques to suppress mixed Gaussian and impulsive noise. a Test image. b Noisy image. c NLM filter [3]. d BM3D filter [9]. e Bilateral filter [52]. f Vector median filter [1]

This effect is depicted in Fig. 1, in which the restoration of a degraded image distorted by mixed noise is presented using filters intended for Gaussian or impulsive noise suppression. As can be observed, the popular, highly effective techniques like Non-Local Means (NLM) [3, 4], Block-Matching and 3D Filtering (BM3D) [9] or Bilateral Filter (BF) [52] are unable to suppress the impulses and the final filtering result is of unacceptable quality (see Fig. 1c–e). The same applies to the methods of impulsive noise removal, like vector median filter (VMF) [1], which are generally unable to reduce the Gaussian noise component as depicted in Fig. 1f.

The widely used VMF efficiently removes the impulses; however, as its output is one of the pixels from the filtering window, the VMF is not able to reduce the Gaussian noise. To alleviate this drawback, the average of the most reliable pixels, determined using the reduced ordering technique, is used to reduce the noise contamination [15, 21, 24, 29, 33, 34, 38, 47, 48].

Very often the mixed noise is being suppressed by applying first a filter suitable for the removal of impulsive and then the one intended for the reduction of Gaussian noise. However, such a scheme is not effective, as the consecutive application of two filters leads to significant image distortions and substantial increase in the computational burden [27].

Another approach to the problem of mixed noise reduction is based on the switching filtering [10, 18, 27], which detects the impulses and removes them using a suitable technique replacing the remaining samples with a filter designed for the Gaussian noise. Such procedure can be effective when the contamination is not severe; otherwise, the detection module fails to detect the impulses which are masked by the Gaussian noise.

An efficient family of filters is utilizing the concept of a peer group introduced in [5, 11, 41, 42] and its fuzzy extensions [27, 28], in which a combination of impulsive noise detection and a replacement scheme based on averaging is performed. Another group of filters relies on the concept of geodesic digital paths [8, 25, 26, 51], which determines the connection cost between pixels belonging to the processing window used as weights in the averaging process.

The authors of [14] described the Rank of Ordered Absolute Differences (ROAD) statistic for impulse detection and combined it with the bilateral denoising scheme [52], designing a trilateral filter able to efficiently reduce the mixed noise. This filter, although intended for gray-scale images, can be also applied to color images, replacing the difference in intensities by the distance in a given color space.

In [20], a method for the restoration of heavily damaged images, in which Bayesian classification of the input pixels is combined with the kernel regression framework, was proposed. In [46], similarly to the ROAD statistic, but for color images, a sum of distances to the k-nearest pixels is used to calculate the weights for each pixel that can be treated as a measure of pixel distortion and these coefficients are used in the weighted average of the pixels in the processing window.

In this paper, we propose a new technique which is able to cope simultaneously with the two kinds of noise. The paper is structured as follows. In Sect. 2, the new filtering design is described. In the next section, the results of experiments and a comparison with competitive filters are presented. Finally, some conclusions are drawn in Sect. 4.

2 Proposed filtering design

Various techniques of Gaussian noise reduction has been proposed in the recent years. A widely used family of filters is based on the BF [52] which takes into the account the similarity between pixels from a local processing window and their topographic distance. Assuming that the pixels of a local processing block \({\mathcal {B}}\) of size \((2r+1)\times (2r+1)\) are denoted as \({\mathbf {x}}_1, \ldots ,{\mathbf {x}}_N\), where \({\mathbf {x}}_1\) is in the center and N is the number of pixels in \({\mathcal {B}}\), the output \({\mathbf {y}}_1\) of BF which replaces the central pixel \({\mathbf {x}}_1\) is

$$\begin{aligned} \varvec{y}_1= \frac{\sum _{k=1}^{N} w_1(\varvec{x}_1,\varvec{x}_k)\cdot w_2(\varvec{x}_1,\varvec{x}_k) \cdot \varvec{x}_k}{ \sum _{k=1}^{N} w_1(\varvec{x}_1,\varvec{x}_k)\cdot w_2(\varvec{x}_1,\varvec{x}_k)}, \end{aligned}$$
(1)

where the weights \(w_1\) and \(w_2\) are usually defined as

$$\begin{aligned} w_1(\varvec{x}_1,\varvec{x}_k)=\exp \left\{ - \frac{\Vert \varvec{x}_1-\varvec{x}_k\Vert }{2\sigma _1^2} \right\} , \end{aligned}$$
(2)

where \(\Vert \cdot \Vert \) denotes the Euclidean distance in the RGB color space, and

$$\begin{aligned} w_2(\varvec{x}_1,\varvec{x}_k)=\exp \left\{ - \frac{ \rho (\varvec{x}_1,\varvec{x}_k) }{2\sigma _2^2} \right\} , \end{aligned}$$
(3)

where \(\rho \) stands for the topographic distance between the pixels on the image domain. Thus, the BF combines the closeness of pixels in the color space and their topographic proximity. The parameters \(\sigma _1\) and \(\sigma _2\) control the influence of the weights on the final filter output.

Since its introduction, various modifications of the BF, aiming mainly at increasing its ability to preserve image details, have been introduced [17, 39, 40, 56, 57]. However, although effective in the case of Gaussian noise, the bilateral filter cannot remove the impulses, which are treated as tiny details. To alleviate this problem, various designs introduce additional weighting factors which diminish the influence of outliers on the final filtering outcome.

Fig. 2
figure 2

Calculation of the ROAD measure

In [14], an extension of the bilateral filter based on the ROAD measure was proposed. The so-called trilateral filter assigns to each pixel its measure of impulsiveness, which is considered when building the average over the pixels belonging to the local processing region. The indicator of pixel’s distortion is defined as

$$\begin{aligned} \text {ROAD}=\sum _{k=1}^{\alpha } d_{1(k)}, \end{aligned}$$
(4)

where \(d_{1(k)}\) is the kth smallest Euclidean distance in the RGB color space between the central pixel \(\varvec{x}_1\) of a small window \({\mathcal {W}}\) centered at \(\varvec{x}_1\) and \(\alpha \) denotes the number of close neighbors. If the central pixel is distorted by impulsive noise, then the corresponding value of ROAD is high. This value will be high even if the central pixel is an impulse and has close, similarly damaged neighbors. For example, in a \(3\times 3\) window, setting \(\alpha =5\), the ROAD will fail to detect the impulses and will be small if the filtering window contains 5 similar impulses, which is unlikely even for strong impulsive noise.

Figure 2 shows the calculation of the ROAD coefficient for the gray-scale image, when \(\alpha =3\). As can be observed, generally the value of the \(\alpha \) parameter is of high importance, as in this exemplary situation, for higher \(\alpha \) the central pixel does not possess close neighbors and the ROAD would be substantially increased [12, 23, 24, 4345, 54, 55].

The proposed filtering design, which will be called Robust Local Similarity Filter (RLSF), is based on the ROAD concept. We assign pixels \(\varvec{x}_j\), \(j=1,\ldots ,N\) from a region \({\mathcal {B}}\) surrounding the central pixel \(\varvec{x}_1\), the ROAD calculated as the sum of the smallest distances between \(\varvec{x}_j\in {\mathcal {B}}\) and the pixels contained in a small window \({\mathcal {W}}\), typically of size \(3\times 3\) centered at \(\varvec{x}_1\). The construction of the modified ROAD is illustrated again for a gray-scale image in Fig. 3. The central pixel \(\varvec{x}_1\) of a processing region has the intensity 154 and the ROAD of pixel with intensity 55 is calculated summing the \(\alpha \) smallest distances to the pixel belonging to \({\mathcal {W}}\) in the processing block center (red window).

In this way, if a pixel from the processing region is corrupted, its ROAD will be high, as it is unlikely that the small window in the center will also have similar outliers. The important feature of the new design is that the central pixel \(\varvec{x}_1\) may be corrupted and the ROAD assigned to a pixel \(\varvec{x}_j\) from \({\mathcal {B}}\) will be not affected, as this pixel will find uncorrupted close pixels in the small window \({\mathcal {W}}\) centered at \(\varvec{x}_1\).

Fig. 3
figure 3

Calculation of the similarity measure between a pixel with intensity 55 (upper left corner) and the \(3\times 3\) window centered at the processed pixel \(\varvec{x}_1\) with intensity 154. The processing block \({\mathcal {B}}\) is depicted by green and the window \({\mathcal {W}}\) by red square (color figure online)

The structure of the proposed design is similar to the BF; however, to decrease the computational load, we neglect the topographic distance between pixels

$$\begin{aligned} \varvec{y}_1=\frac{\sum _{j=1}^{N} w_j \cdot \varvec{x}_j}{\sum _{j=1}^{N} w_j}, \end{aligned}$$
(5)

with

$$\begin{aligned} w_j={\mathcal {K}} \left( \frac{1}{\alpha } \sum _{k=1}^{\alpha } d_{j(k)} \right) , \end{aligned}$$
(6)

where \({\mathcal {K}}\) denotes the kernel function (e.g., Gaussian) and \( d_{j(k)}\) is the kth smallest Euclidean distance in the RGB color space between \(\varvec{x}_j\) and the pixels of \({\mathcal {W}}\).

3 Experiments

The proposed filter was evaluated on a set of color test images depicted in Fig. 4. The images were first distorted by Gaussian noise with standard deviation in the range 10–50, (with step 10), and then, 10%–50% of the pixels were replaced by random-valued impulsive noise, so that every RGB channel of a corrupted pixel was assigned a value drawn from the uniform distribution from the range [0,255]. To simplify the notation, the noise intensity p will denote a Gaussian noise with standard deviation p and with \(p\%\) pixels with randomly corrupted channels.

Fig. 4
figure 4

Color test images used in experiments

The restoration efficiency has been assessed using the commonly used PSNR measure defined as

$$\begin{aligned}&\text {MSE} = \frac{1}{3N} \sum _{j=1}^{N}\sum _{q=1}^{3} (x_{j,q}-\hat{x}_{j,q})^2, \end{aligned}$$
(7)
$$\begin{aligned}&\text {PSNR} = 10\log _{10} \left( \frac{255^2}{\text {MSE}}\right) , \end{aligned}$$
(8)

where \(x_{j,q}\), \(q=1,2,3\) are the RGB channels of the original image pixels and \(\hat{x}_{j,q}\) are the restored components.

Fig. 5
figure 5

Plots of the kernel functions

Fig. 6
figure 6

Dependence of the optimal PSNR obtained using the proposed RLSF on \(\alpha \) and r parameters using the Gaussian and Epanechnikov kernels. The test images shown in Fig. 4 were contaminated with mixed noise of intensity \(p=30\)

Fig. 7
figure 7

Dependence of PSNR values obtained using the proposed RLSF with the size of processing block \(r=4\) and setting \(\alpha =4\), on the \(\sigma \) parameter value for different kernel functions \({\mathcal {K}}\). The color test images depicted in Fig. 4 were contaminated with mixed noise of intensity \(p=30\)

Fig. 8
figure 8

Dependence of PSNR values obtained using the proposed RLSF with Epanechnikov kernel on \(\sigma \) value, for \(r=4\), \(\alpha =4\) on test images distorted with various noise level

Fig. 9
figure 9

Comparison of the efficiency of the new RLSF with \(r=4\), \(\alpha =4\) and \(p=30\), using the Gaussian and Epanechnikov kernels with the ATVMF and FVMF

In our experiments, various kernel functions were used to determine the weight in (6). The suitability of the following functions, whose graphs are presented in Fig. 5, was evaluated:

  • Triangular: \(K(x)=1-(x/\sigma ),\quad |x/\sigma | \le 1\),

  • Epanechnikov: \(K(x)=1-(x/\sigma )^2 ,\quad |x/\sigma | \le 1\),

  • Biweight: \(K(x)=(1-(x/\sigma )^2)^2 ,\quad |x/\sigma | \le 1\),

  • Triweight: \(K(x)=(1-(x/\sigma )^2)^3 ,\quad |x/\sigma | \le 1\),

  • Tricube: \(K(x)=(1-|x/\sigma |^3)^3 ,\quad |x/\sigma | \le 1\),

  • Gaussian: \(K(x)=\exp (-(x/\sigma ))^2\),

  • Cosine: \(K(x)=\cos (\pi x/ 2\sigma ) ,\quad |x/\sigma | \le 1\).

First, we investigated the influence of the block size r and \(\alpha \) parameter in (6) on the filtering efficiency expressed in terms of the PSNR measure applying various kernels. The \(\sigma \) parameter of the kernels was adjusted so that the best PSNR value was achieved. The simulations revealed that independently of the noise contamination level and the applied kernel, for various natural color images, the optimal settings of the block \({\mathcal {B}}\) size r and the \(\alpha \) parameter of the ROAD measure are in the range [3–5], and the setting \(r=\alpha =4\) was used for the comparison of the proposed design with competitive denoising methods. Figure 6 depicts the dependence of the best possible PSNR metric on r and \(\alpha \) parameters for the test images shown in Fig. 4 using the Gaussian and Epanechnikov kernels. As can be observed, the structure of the visualizations is similar.

Figure 7 depicts the influence of the \(\sigma \) parameter on the restoration results for a block \({\mathcal {B}}\) size \(r=4\) and \(\alpha =4\) in \({\mathcal {W}}\), when using various kernel functions. As expected, the optimal PSNR values were not dependent on the choice of the kernel shape; however, the Triweight, Tricube or Epanechnikov functions are less dependent on the \(\sigma \) value than the Gaussian kernel. This effect is beneficial, as the optimal value of the kernel smoothing parameter \(\sigma \) is slightly dependent on the image structure and also on the contamination intensity as exhibited in Fig. 8. Therefore, for further experiments, the Epanechnikov kernel was chosen, as it not only is less sensitive to the \(\sigma \) value but is also computationally less demanding than the widely used Gaussian function. Due to the fact that this kernel drops to 0, it is also more robust to the outliers introduced by the impulsive noise process.

Analyzing the plots of this figure, the setting \(\sigma =100\) enables to achieve results very close to the optimal ones for considerable amount of noise distortions. For images degraded by less intensive mixed noise, lower values of the smoothing parameter, e.g., \(\sigma =50\), should be used.

Table 1 Dependence of PSNR in dB for various images denoised using the proposed RLSF (\(r=4\), \(\alpha =4\)) with various kernels, as compared with competitive filters

The proposed filtering design has been compared with a set of competitive filters whose structure has been described in detail in [7]

  • Fuzzy vector median filter (FVMF),

  • Fuzzy ordered vector median filter (FOVMF),

  • Fuzzy vector directional filter (FVDF),

  • Adaptive nearest-neighbor filter (ANNF),

  • Adaptive nearest-neighbor multichannel filter (ANNMF),

  • Directional distance filter (DDF),

  • Alpha-trimmed vector median filter (ATVMF),

  • Hybrid directional filter (HDF),

  • Fuzzy ordered vector directional filter (FOVDF),

  • Entropy vector median filter (EVMF),

  • Adaptive hybrid directional filter (AHDF).

The comparison with the state-of-the-art denoising methods presented in Table 1 and also in Fig. 9 shows that the proposed filter clearly outperforms the competitive techniques for medium and high noise contamination levels. The Epanechnikov kernel yields slightly lower PSNR values; however, for applications in which the computational complexity plays a crucial role, the use of this kernel is recommended.

The RLSF better preserves image edges and produces visually pleasing results, without noticeable unfiltered noise. It is also worth noticing that the proposed design is significantly faster than the NLM and BM3D methods and also much faster than the above-listed filters for the default \(9\times 9\) processing block.

4 Conclusions

In this paper, a new approach to the suppression of mixed Gaussian and impulsive noise has been presented. The main novelty of this work lies in the introduction of a novel efficient measure of the similarity of a pixel from the processing region and a small filtering window centered at the pixel which is being restored. The experimental results revealed that the new filter is competitive with existing denoising solutions. Future work will be focused on the introduction of additional measures which evaluate the impulsiveness of pixels taken for the weighted averaging process.