1 Introduction

The increase in use of color images in multimedia technologies and telecommunication has accelerated significantly in recent years. This development has been accompanied by the proliferation of color image capturing devices and looks set for continued expansion in the future. As a result, the interest in color image processing is rapidly growing.

Very often the quality of color images is degraded by various types of noise, whose suppression is indispensable to facilitate subsequent image processing steps. Therefore, noise reduction is regarded as one of the most frequently performed operations [17].

In this work, we focus on a special kind of image deterioration, called impulsive noise, which can be caused by malfunctioning camera photosensors, optic imperfections, electronic instability of the image signal, aging of the storage material, faulty memory locations in hardware or transmission errors due to natural or man-made processes [811]. Common sources of impulsive noise include also lightnings, strong electromagnetic interferences caused by faulty or dusty insulations of high-voltage powerlines, car starters, and unprotected electric switches. These noise sources generate short time duration, high-energy pulses which disturb the regular signal, resulting in the acquisition of color image samples differing significantly from their local neighborhood in the image domain.

In this paper, the color image is defined as a two-dimensional matrix consisting of N pixels \(\user2{x}_i=({x}_{i}^{1},x_{i}^{2}, x_{i}^{3}), \) where the index \(i=1,\ldots,N\) indicates the pixel location on the image domain. The vector components x q i , for q = 1, 2, 3 represent the RGB color channels values quantified into the integer domain.

Generally, filtering operators work on the assumption that the local image features can be extracted from a small image region centered at pixel x i , called a sliding filtering window W i . Thus, the output of the filtering operation will depend only on the n samples contained within the window centered at \(\user2{x}_i, \) which will be also denoted for convenience as \(\user2{x}_1,(W=\{ \user2{x}_1, \user2{x}_2, \ldots, \user2{x}_n \}\)).

The most widely used filtering approaches are based on the reduced vector ordering, which assigns a dissimilarity measure to each color pixel from the filtering window [1, 4, 6, 1214]. The aggregated dissimilarity measure assigned to pixel x j is defined as

$$ D_j =\sum_{k=1}^n{d(\user2{x}_j ,\user2{x}_k)} , \quad \user2{x}_j, \user2{x}_k\in W, $$
(1)

where \(d(\cdot)\) is the chosen dissimilarity measure. The scalar accumulated dissimilarity measures are then sorted and the vectors \(\user2{x}_1,\user2{x}_2,\ldots, \user2{x}_n\) are correspondingly ordered

$$ D_{(1)} \le D_{(2)}\le \cdots \le D_{(n)} \; \rightarrow \; \user2{x}_{(1)} \prec\user2{x}_{(2)}\prec \cdots \prec \user2{x}_{(n)},$$
(2)

where \(\prec\) denotes the order relation between vectors and D (r) denotes the rth smallest value of D [1518]. The choice of the dissimilarity measure strongly influences the properties of the resulting filter. Usually the angle and distance between vectors is utilized; however, various combinations of the magnitude and directional processing can also be applied [1928].

Many filtering solutions define the vector \(\user2{x}_{(1)}\) in (2) as their output, since vectors that diverge significantly from the samples of W appear in the higher indexed locations in their ordered sequence. Using the Euclidean distance as a dissimilarity measure, the vector median filter (VMF) is obtained [29]. The VMF output \(\user2{x}_{(1)}\) is one of the pixels from the filtering window, for which the sum of distances to all other vectors from W is minimized

$$ \user2{x}_{(1)}=\underset{{\user2{x}_j} \in W}{\operatorname{arg min}} \sum\limits_{k=1}^{n} \| \user2{x}_j-\user2{x}_{k} \|= \underset{\user2{x_j} \in W}{\operatorname{arg min}} \sum\limits_{k=1}^{n} d_{jk}, $$
(3)

where \(\|\!\cdot\!\|\) denotes the Euclidean norm and d jk denotes the distance between \(\user2{x}_j\) and \(\user2{x}_k. \)

If the image contamination intensity is high, the output of the filters which are based on the reduced ordering can also be corrupted by noise, as the vector median belongs to the set of noisy pixels contained in the processing window. This effect can be alleviated applying the so-called marginal median filter (MMF), which outputs the pixel, whose components are the medians of the scalar values of the corresponding channels. However, such an approach leads to the generation of color artifacts, especially at image edges, as the information on the correlation between the color image channels is neglected. Therefore, various techniques are applied to circumvent situations in which the filter output contains noisy components [4, 6, 22, 30, 31].

Instead of choosing the vector median x (1) as the filter output, the average of the α first ordered vectors \(\user2{ x}_{(1)},\ldots,\user2{x}_{(\alpha)}\) can be utilized to replace the central pixel of W. The so-called α-trimmed mean can be used for reducing mixed impulsive and Gaussian noise, as it combines the properties of the median and averaging operators.

The output of the VMF can also be examined whether it contains noisy components by analyzing the color channels of the samples in W in a marginal way. In [32], the robust VMF (RVMF) has been proposed, in which the components of the color pixels are arranged separately into ordered sequences, utilizing the absolute values of the differences between the scalar components as a distance measure. If the q-th component of a pixel \(\user2{x}_i\) is denoted as x q i , (q = 1, 2, 3), then the sum of distances in (1) reduces to D q i  = ∑ n j=1 |x q i  − x q j | and the ordered sequence \(D_{(1)}^q,\ldots, D_{(n)}^q\) implies the marginal ordering of the vector components \(x_{(1)}^q,\ldots, x_{(n)}^q. \) In this way, the corrupted VMF output components can be detected on the basis of their high marginal ranks.

The elements of W can be additionally ordered using the values of the fuzzy similarity measures between a given pixel and the VMF output. Thus, a set of vectors similar to the vector median can be determined, whose components can be used for the replacement of the detected corrupted channels of the vector median [32]. Another possibility is to apply the marginal median operation to the set of vectors closest to the vector median, in order to create a noise-free filter output [33]. As a result, an adaptive MMF (AMMF) filter has been developed.

Various designs based on the concepts derived from the fuzzy sets theory combined with the order statistics have been also described [3449]. Another family of techniques aimed at the improvement of the detail preservation of the filters based on reduced ordering is utilizing the concept of vector weighting, which privileges the central pixel of the processing window [5056].

The VMF and other methods based on the reduced ordering of vectors process every image pixel, regardless whether it is noisy or not, which leads to the removal of image details, causing image blurring and generation of color artifacts. In order to alleviate the problem of excessive image smoothing various switching filters, that replace only the corrupted pixels, have been proposed.

The structure of a switching filter is presented in Fig. 1. The filter output depends on the impulsive noise detector, which decides whether a given pixel will be processed by an appropriate denoising filter or left unchanged, (identity filter). Thus, the efficiency of a switching filter depends both on the quality of the impulse detection scheme and on the applied restoration framework, which replaces the detected impulses with estimates derived from the samples belonging to a local processing window.

Fig. 1
figure 1

Switching filtering structure

In [5759], the concept of the Vector Sigma Filter has been proposed. The switching filtering scheme is utilizing the cumulated Euclidean distance defined in (1) as a measure of the dispersion of vectors in the processing window, which is used for the detection of outliers introduced by the impulsive noise.

In [60], the distance between the central pixel of the window and the α-trimmed mean calculated using the sequence in (2) was chosen as a dissimilarity measure. If the value of the distance exceeds a predefined threshold, then the central pixel is declared as corrupted and is replaced by VMF; otherwise, it is kept unchanged. A filtering scheme, utilizing the angular distance between vectors was presented in [61].

The sum of the α smallest distances between the central pixel of the filtering window and the remaining pixels was used as a measure of pixel distortion in [49, 62]. This concept is an extension of the statistics introduced in [63]. In [64, 65] the cumulated similarity measures, defined as decreasing functions of the Euclidean distance between pixels were assigned to the color samples from the filtering window. The filter was made adaptive by adjusting its parameter using a simple noise intensity level estimator, in which a pixel is considered as not disturbed by the noise process, if there exist at least two pixels whose distance to the central pixel does not exceed a predefined threshold. The concept has been further extended in [6670].

In order to alleviate the problems caused by the blurring properties of the VMF and other filters utilizing the ordering scheme, a filtering method using the concept of a peer group was introduced in [71, 72] and extensively used in various filtering designs [49, 57, 66, 7378]. The peer group associated with the central pixel \(\user2{x}_i\) of a filtering window W i denotes the set of close pixels, whose distance to x i is not exceeding a given threshold. In this way, the pixels are classified as similar to the central pixel or declared as outliers, which should be replaced by a suitable robust filter.

Another group of impulsive noise reduction techniques is based on the methods derived from the mathematical morphology. The main difficulty of the application of morphological methods into color image processing lies in the required vector ordering scheme [3, 79, 80]. The definitions of the basic mathematical morphology operations were generalized in various ways, so that they can work on color images and can be applied for impulsive noise suppression [8186].

The rank of a pixel in a sequence induced by a reduced ordering carries a useful information on the pixel’s similarity to other samples from the filtering window. In [87], for each pixel of W the distances to all other pixels were calculated, which enables to assign each pixel the ranks with respect to each of the remaining samples. The filter output is the pixel with lowest mean rank, which is most similar to a given dataset from the filtering window. The ranks of the pixels were also used for the detection of impulses in [88, 89].

An interesting approach to the problem if impulsive noise removal is utilizing the quaternionic representation to establish efficient measures of pixel corruption [9092]. Another group of denoising techniques are based on the concepts derived from the robust statistical procedures [18, 9396]. These methods are capable of removing even strong noise, while preserving fine image details.

In this paper, a new efficient switching filtering scheme is presented. The main advantage of the novel approach is its ability to suppress the noise component, while preserving image details. The structure of the filter is based on the reduced ordering statistics and is characterized by low computational complexity, which enables the adoption of the novel technique in real-time applications.

The remainder of the paper is organized as follows: In the next Section we describe the impulsive noise models, which will be used for the illustration of the proposed filtering framework and the analysis of its efficiency. Then, the rank weighted generalization of the VMF is presented. Section 4 outlines the construction of an impulsive noise detection scheme. The following Section addresses the adaptive switching design, capable of suppressing impulses in images contaminated by noise sources of varying intensity. The next Section is devoted to the comparison of the proposed filter with some effective methods known from the rich literature. Some final conclusions are drawn in the last Section of the paper.

2 Impulsive noise models

In order to illustrate the construction of the new switching filter and to evaluate its effectiveness we used three models of impulsive noise. In the first impulsive Noise Model denoted as NM1, the noisy pixels \(\user2{x}_{i}=\{x_{i}^{1},x_{i}^{2},x_{i}^{3}\}\) are defined as [4, 12, 13]

$$ x_{i}^{q} = \left\{\begin{array}{l} v_{i}^{q} \quad {\rm with \,probability}\quad\pi, \\ o_{i}^{q} \quad {\rm with\, probability} \quad 1-\pi,\end{array} \right. $$
(4)

where o q i denotes the q-th component of the original pixel at position i, (q = 1,2, 3), and the contamination component v q i is a random variable which takes on the values 0 or 255 with equal probability, assuming 8-bit per channel color image representation. The pixels affected by this so-called salt & pepper impulsive noise may have corrupted 1, 2 or all 3 channels. The probability, that none of the channels will be distorted is (1 − π)3, and therefore the fraction of corrupted pixels is equal to p = 1 − (1 − π)3.

The structure of the second noise model, denoted as NM2, is similar. It differs only in the definition of the variable v q i , which can take on any value from the range [0,255]. This kind of noise is usually called uniform or random-valued impulsive noise.

The third kind of noise, denoted as NM3, is defined as

$$ {x}_{i} = \left\{\begin{array}{l} \user2{v}_{i} \quad {\rm with\,probability} \,p,\\ \user2{o}_{i} \quad {\rm with\, probability} \,1-p, \\\end{array} \right. $$
(5)

where \(\user2{v}_i=\{v_{i}^{1},v_{i}^{2},v_{i}^{3}\}\) and \(v_{i}^{q}\in [0,255]. \) In this impulsive noise model, the affected pixels have corrupted all three channels, which take on random values from the interval [0, 255]. Figure 2 shows the noisy color test image PEPPERS contaminated by the three noise models with intensity p = 0.1.

Fig. 2
figure 2

Color test image PEPPERS (a) contaminated by the noise model NM1 (b), NM2 (c) and NM3 (d) with intensity p = 0.1

For the measurement of the restoration quality, the commonly used root mean squared error (RMSE) expressed through the peak signal to noise ratio (PSNR) and the mean absolute error (MAE) was employed, as the RMSE is a satisfactory measure of the efficiency of impulsive noise suppression and MAE describes well the filter’s efficiency of detail preservation [4].

The PSNR is defined as

$$ {\rm PSNR} = 20 \log_{10}\left({\frac{{255}}{ \sqrt{{\rm MSE}} }} \right), \quad {\rm MSE} =\frac{1}{3 N} \sum\limits_{i = 1}^{N} \sum\limits_{q=1}^{3}\left({x}_{i}^{q} - {o}_{ i}^{q} \right)^{2}, $$
(6)

where N is the total number of image pixels, x q i and o q i denote the q-th component of the noisy image pixel channel and its original, undisturbed value at a pixel position i, respectively. The MAE measure is given by

$$ {\rm MAE}=\frac{1}{3N}\sum\limits_{i = 1}^{N} \sum\limits_{q = 1}^{3} \left| x_{i}^{q} -o_{i}^{q} \right|. $$
(7)

3 Rank weighted vector median filter

The reduced ordering schemes are based on the sum of the dissimilarity measures between a given pixel and all other samples from the filtering window W. In this way, the output of the VMF is the pixel whose average distance to other pixels is minimized.

The distances \(d_{ij}=\| \user2{x}_i-\user2{x}_j\|\) between the pixel \(\user2{x}_i\) and all other pixels x j belonging to W, \((j=1,\ldots,n)\) can be ordered

$$ d_{i1}, d_{i2}, \ldots, d_{in} \rightarrow d_{i(1)} \leq d_{i(2)} \leq \cdots \leq d_{i(n)}, $$
(8)

and the ranks of the ordered distances can be used for building the cumulated distances in (1).

If r denotes the rank of a given distance, then d i(r) will stand for the corresponding distance value and instead of the aggregated distances in (1) we can build a weighted sum of distances, utilizing the distance ranks

$$ \Updelta_i=\sum_{r=1}^{n} f(r)\cdot d_{i(r)}, $$
(9)

where f(r) is a decreasing weighting function of the distance rank r.

Then, the rank weighted sum of distances calculated for each pixel belonging to W can be sorted and a new sequence of vectors obtained

$$ \Updelta_{(1)} \leq\Updelta_{(2)}\leq \cdots \leq \Updelta_{(n)} \rightarrow\user2{x}_{(1)}^* \prec \user2{x}_{(2)}^* \prec \cdots \prec\user2{x}_{(n)}^{*}, $$
(10)

where the vector \(\user2{x}_{(1)}^{*}\) is the output of the rank weighted vector median filter (RWVMF).

Similarly to (3) the RWVMF output \(\user2{x}_{(1)}^{*}\) an be defined as

$$ \user2{x}_{(1)}^{*}= \underset{\user2{x}_j \in W}{\operatorname{arg min}} \sum\limits_{r=1}^{n} f(r)\cdot d_{j(r)}. $$
(11)

Applying the constant function \(f(r)=1,r=1,2,\ldots, n, \) we obtain \(\Updelta_i=D_i\) and \(\user2{x}_{(1)}^{*}=\user2{x}_{(1)}. \) For a step-like function

$$ f(r) = \left\{ \begin{array}{ll} 1, & \hbox{for} \; r \le \alpha, \alpha \leq n, \\ 0, & \hbox{otherwise}, \\ \end{array} \right. $$
(12)

the sharpening vector median filter (SVMF) presented in [97] is obtained.

Extensive experiments revealed that very good denoising results are achieved using monotonously decreasing functions, like f(r) = 1/r and f(r) = 1/r 2, [98100]. The weighting function decreases the influence of large distances introduced by the outliers injected by the noise process, which enables to efficiently remove the impulsive noise while enhancing the image edges.

The efficiency of the rank weighted generalization of the VMF is shown in Figs. 3 and 4, in which the color test image PEPPERS is corrupted by impulsive noise NM1 and restored with

  • marginal median filter (MMF),

  • vector median filter (VMF),

  • directional-distance filter (DDF) [21, 20],

  • hybrid directional filter (HDF) [28],

  • adaptive marginal median filter (AMMF) [33],

  • robust vector median filter (RVMF) [32],

  • FVMF (fuzzy vector median filter) [22, 46],

  • FOVMF (fuzzy ordered vector median filter) [22, 46], and with the

  • rank weighted VMF with the 1/r weighting (RWVMF1) and 1/r 2 (RWVMF2).

As can be observed the rank-based denoising scheme copes very efficiently with the impulsive noise degradation and produces images with very sharp edges.

Fig. 3
figure 3

Efficiency of the RWVMF as compared with other denoising methods, (first iteration): a test image, b image corrupted by NM1 noise, p = 0.4, c output of MMF, d VMF, e DDF, f HDF, g AMMF, h RVMF, i FVMF, j FOVMF, k and l outputs of RWVMF1 and RWVMF2

Fig. 4
figure 4

Efficiency of the RWVMF as compared with other denoising methods, (second iteration): a test image, b image corrupted by NM1 noise, p = 0.4, c output of MMF, d VMF, e DDF, f HDF, g AMMF, h RVMF, i FVMF, j FOVMF, k and l outputs of RWVMF1 and RWVMF2

4 Impulsive noise detection

The efficiency of a switching filtering design is dependent mainly on the impulse detection module. If the detector fails to identify corrupted pixels, they will be left unchanged, leading to poor image restoration results. If however, the detector classifies correctly the impulses, but also declares the undisturbed pixels as noisy, much of the image details will be lost.

In this paper, we propose an impulsive noise detection scheme which efficiently detects the corrupted pixels, while keeping the samples not affected by the noise process unchanged. In order to decide whether a pixel of a color image is corrupted by impulsive noise, the difference between the cumulated weighted distance \(\Updelta_{1}\) assigned to the central pixel of the filtering window and the value of \(\Updelta _{(1)} \) corresponding to the rank weighted vector median filter output is used [98100]. In this way, the strength of the impulsive contamination can be estimated as the difference between \(\Updelta_{1}\) and \(\Updelta_{(1)}. \)

Figures 5 and  6 depict the noisy test image contaminated by impulses originating from NM1 with intensity p = 0.1 and p = 0.3 (a), values of the aggregated, rank weighted distances assigned to the central pixel \(\user2{x}_1\) of the filtering window \(\Updelta_{1}\) (b) and the smallest values \(\Updelta_{(1)}\) (c). The differences \(\delta=\Updelta_{1}-\Updelta_{(1)}\) depicted in (d) serve as measures of impulsive noise contamination. It can be observed that the map of the impulsiveness correlates well with the real contamination.

Fig. 5
figure 5

Illustration of the impulsive noise detection method using the PEPPERS color image corrupted by NM1 noise of p = 0.1 and a weighting function f(r) = 1/r

Fig. 6
figure 6

Illustration of the impulsive noise detection method shown using the PEPPERS color image corrupted by NM1 noise of p = 0.3 and a weighting function f(r) = 1/r

A direct comparison between the real noise strength expressed as a Euclidean distance between the original and noisy pixels in the RGB color space and the noise maps obtained using the weighting schemes is provided in Figs. 7 and 8, which show the impulse detection results for two contamination levels. As can be observed, the weighting of the distances introduced in the RWVMF improves the impulse detection results.

Fig. 7
figure 7

Comparison of the real noise contamination map (a) with the maps of detected noise using different weighting schemes (bd), (part of the color image PEPPERS corrupted by NM1 noise of p = 0.1 shown in Fig. 5)

Fig. 8
figure 8

Comparison of the real noise contamination map (a) with the maps of detected noise using different weighting schemes (bd), (part of the color image PEPPERS corrupted by NM1 noise of p = 0.3 shown in Fig. 6)

Figure 9 depicts the scatter plots showing the correlation between the real noise strength and the detected impulsiveness of the image pixels. The results evaluated using a set of color test images depicted in Fig. 10 reveal a high correlation between the real and detected noise. The plots also show a lack of significant influence of the noise models and image structures on the impulse detection efficiency.

Fig. 9
figure 9

Illustration of the correlation between the real noise intensity (x axis) and the output of the proposed noise detector (y axis) for contamination ratio p = 0.1 of the used noise models. The correlation coefficient ρ is provided for each scatter plot

Fig. 10
figure 10

Color test images used for the evaluation of the restoration results

5 Adaptive switching filter

The structure of the proposed switching filter is quite simple. If the difference \(\delta=\Updelta_{1}-\Updelta_{(1)}\) exceeds a threshold value T h , then a pixel is declared as corrupted by a noise process; otherwise, it is treated as not disturbed [101]

$$ \user2{y}_{1} = \left\{\begin{array}{*{20}l} \user2{x}_{\rm AMF}, & \hbox{if} \,{\Updelta}_{1}-\Updelta_{(1)}> T_h, \\ \user2{x}_{1}, &\hbox{otherwise}, \end{array}\right.$$
(13)

where \(\user2{y}_1\) is the switching filter output, \(\user2{x}_{1}\) is the central pixel of the filtering window and \(\user2{x}_{\rm AMF}\) is the Arithmetic Mean Filter (AMF) output computed using only the pixels declared by the detector as not corrupted by the noise process [62, 66].

If all neighbors of the central pixel \(\user2{x}_1\) of the filtering window are found to be corrupted, then the RWVMF applied to all pixels from W is taken as the filter output. However, the need for substituting the central pixel by the RWVMF output occurs only for very high image contamination levels.

Of course, the efficiency of the switching scheme depends heavily on the value of the thresholding parameter. If the threshold T h is too low, the filter will be replacing uncorrupted pixels. On the other hand, if it is too high, many corrupted pixels will pass the filter without being rectified.

As could be expected, the optimal setting of T h depends on the contamination intensity. Figure 11 depicts the dependence of the best possible PSNR restoration quality measure values on the threshold T h for two images chosen from the set of ten images shown in Fig. 12. Clearly, the optimal threshold T opt yielding the best PSNR value is decreasing with increasing noise contamination level, and does not depend significantly on the image structure and the applied noise model.

Fig. 11
figure 11

Dependence of PSNR on the threshold parameter T h for two test color images depicted in Fig. 12 for the 1/r weighting scheme and different noise models

Fig. 12
figure 12

Color test images used for the construction of an adaptive filtering scheme

Another important issue is the application of the weighting scheme needed for the estimation of the measure of impulsiveness δ described in the previous Section. Figure 13 exhibits the optimal PSNR values obtained for the four images depicted in Fig. 10 using the two weighting schemes 1/r and 1/r 2. It can be observed that the incorporation of the weights significantly improves the restoration quality when compared with the unweighted scheme in which f(r) = 1. Of course, various other weighting functions could be applied; however, extensive experiments showed that the simple weights guarantee good denoising efficiency, without the need of introducing additional parameters, which would be required to tune the shape of the more sophisticated rank weighted function.

Fig. 13
figure 13

Dependence of the PSNR restoration quality measure on the noise intensity p for different noise models and weighting functions using the GOLDHILL, LENA, PARROTS and PEPPERS test images

The choice of the weighting scheme is a difficult issue as the filter behavior is influenced by the image structure and also depends on the applied noise model. However, taking into account that the weighting function 1/r 2 tends to preserve small clusters of impulses of similar color, which does not compensate a slight increase in PSNR in some cases, we decided to use the 1/r weights in the construction of the adaptive switching filter.

As it became clear that the thresholding parameter T h needs to be adjusted to the noise intensity level, the dependence between the estimated noise intensity and the optimal threshold was to be established. The experiments performed using the images from the collection of test images depicted in Fig. 12 and applying the described noise models indicate an approximately linear dependence between the contamination ratio p and the mean value of the impulsiveness measure δ computed for all image pixels and denoted as \(\bar{\delta}. \) The dependence between the average impulsiveness measure \(\bar{\delta}\) and noise intensity level p is shown in Fig. 14.

Fig. 14
figure 14

Dependence of \(\bar{\delta}\) on the contamination level p for color images depicted in Fig. 12 corrupted with different noise models

The dependence between the optimal threshold T opt yielding the best possible PSNR value on the noise intensity p is presented in Fig. 15. Combining these plots for the three noise models, we obtain the scatter plot depicted in Fig. 16, which reveals a roughly linear dependence with correlation coefficient ρ = 0.79

$$ T_{\rm ADP}=- 2.7 \cdot\bar{\delta}+69.6, $$
(14)

between the adaptive threshold T ADP and \(\bar{\delta}. \) As the mean value of the difference δ can be easily computed, the adaptive threshold value T ADP is adjusted to the estimated intensity of image corruption.

Fig. 15
figure 15

Dependence of T opt on the contamination level p for the color images depicted in Fig. 12 corrupted with different noise models

Fig. 16
figure 16

Dependence between the optimal thresholding parameters T opt and the measure of impulsiveness \(\bar{\delta}\) for the images shown in Fig. 12 contaminated by the three noise models

The comparison of the PSNR results obtained using the proposed Rank Weighted Adaptive Switching Filter (RWASF) with the best possible results achieved with the switching filter with varying threshold T h and 1/r weighting, presented in Table 1, reveals satisfactory results, which are very close to the optimal values. This is due to the rather slowly varying dependence of PSNR on the threshold T h shown in Fig. 11.

Table 1 Comparison of the PSNR values achieved applying the proposed RWASF adaptive method with the best possible results obtained using different weighting functions

6 Comparison with existing techniques

The proposed RWASF was compared with a set of switching filters intended for the suppression of impulsive noise in color images. The filters chosen for comparison are listed in Table 2. Their parameters were set according to the recommendations provided in the appropriate references.

Table 2 Filters used for comparisons [6, 22]

The four images depicted in Fig. 10 were contaminated by the three types of impulsive noise with intensities ranging from 0.05 to 0.3. It is worth noticing that these images were not included in the set of images used to establish the dependence expressed by Eq. (14). The results are summarized in Tables 3,  4 and  5. Due to the space limitations only the PSNR measures are reported; however, the results lead to the same conclusions when using other quality restoration measure like MAE or Normalized Color Distance (NCD) in the Lab color space [4] (bold values indicate best restoration quality).

Table 3 Comparison of the PSNR values obtained when restoring the color test images contaminated with NM1 impulsive noise using the proposed RWASF technique and state-of-the-art methods
Table 4 Comparison of the PSNR values obtained when restoring the color test images contaminated with NM2 impulsive noise using the proposed RWASF technique and state-of-the-art methods
Table 5 Comparison of the PSNR values obtained when restoring the color test images contaminated with NM3 impulsive noise using the proposed RWASF technique and state-of-the-art methods

As can be observed, the proposed filtering method yields results significantly superior to those obtained using the state-of-the-art denoising methods. Only in few cases, for low contamination level, the PGF and SDDFr methods were able to deliver slightly better PSNR and MAE restoration quality values. More detailed comparisons of the results achieved using the new filtering design with the five best competitive filters are shown in the plots of Figs. 17 and  18, which depict the comparison of the filters in terms of the PSNR and MAE restoration quality measures.

Fig. 17
figure 17

Comparison of the efficiency of the proposed adaptive filter with some of the state-of-the-art denoising techniques in terms of the PSNR restoration quality measure for the three models of impulsive noise

Fig. 18
figure 18

Comparison of the efficiency of the proposed adaptive filter with some of the state-of-the-art denoising techniques evaluated in terms of the MAE restoration quality measure for the three models of impulsive noise

The results summarized in the Tables and Figs. 17,  18 are confirmed by the subjective analysis of the results depicted in Figs. 19,  20 and 21 which show the restoration quality achieved using the RWASF as compared with other competitive filters. As can be noticed, the proposed filter better preserves image details, when suppressing the impulsive noise.

Fig. 19
figure 19

Comparison of the efficiency of the proposed switching technique with other denoising methods using a part of the color test image PEPPERS contaminated by NM1 with intensity p = 0.1

Fig. 20
figure 20

Comparison of the efficiency of the proposed switching technique with other denoising methods using a part of the color test image PEPPERS contaminated by NM2 with intensity p = 0.1

Fig. 21
figure 21

Comparison of the efficiency of the proposed switching technique with other denoising methods using a part of the color test image PEPPERS contaminated by NM3 with intensity p = 0.1

An important feature of the filters intended for the impulsive noise removal is their computational complexity, which is especially important in real-time applications. The proposed filtering design is based on the VMF, which in its straightforward implementation requires for each pixel in W the computation of the n(n − 1) Euclidean distances to other samples belonging to the same window. Observing that the distance between two pixels is symmetric and applying the so-called running algorithms [102, 103], the computational load of VMF can be significantly decreased.

The Rank Weighted VMF requires for each pixel in W additional ordering of the distances and their division by an appropriate rank function value. Time consuming is also the calculation of the cumulated weighted distances and their minimum value, which is needed for the computation of the measure of impulsiveness δ. This value has to be compared with the threshold value based on the mean value \(\bar{\delta}. \) If the impulsiveness measure is not exceeding the threshold, then the pixel is declared as undisturbed; otherwise, the filter output is the mean value of the pixels in W, which were found not to be corrupted by the impulsive noise.

As the most computationally demanding step is the calculation of the Euclidean distances, the proposed filter is comparable in speed with the standard VMF. In this way, the new filter is slower than the PGF [23, 72] and other designs based on the peer group concept, in which the main computationally demanding step is the calculation of the distances between the central pixel and its neighbors [22, 66, 68, 7678], without the need for calculating the corresponding distances for all pixels in the window.

The computational burden of the VMF-based approaches can be, however, simplified adopting simpler dissimilarity measures and applying some approximations [23, 30, 31, 104108], which do not decrease significantly the noise filtering performance. Additionally, the methods adopting the VMV concept are well suited for parallel, hardware implementations [109112]. Taking this into account, the computational complexity of the proposed filtering design allows for its application in real-time image processing applications.

7 Conclusions

In the paper, a novel switching filter has been proposed. The filter is based on order statistics and utilizes the weighted cumulative distances between pixels for the detection of samples corrupted by impulsive noise process. The experiments performed on test images contaminated by three noise models revealed a very high efficiency of the proposed design. The incorporated adaptive scheme guarantees satisfactory denoising results without the need of adjusting any parameters. Additionally, the novel filter is characterized by a simple structure, which makes it very attractive for computer vision applications.