1 Introduction

Analog-to-digital conversion errors and improper working of camera sensors are the two main reasons that cause noise amplification in digital images [5, 7, 14]. Presence of noise in any digital image corrupts nature of the image essentially and consequently the resulting forms like object detection, image segmentation and edge detection and so forth turn out to be more difficult. Additionally, execution of subsequent processing is exceedingly influenced. As an image can be influenced by various sort of noise, it is a troublesome task to recognize sort of noise, finding amount of noise present in an image and removal of the noise. Luckily, most part of the noise showed up in the images can be modeled by the Gaussian noise (GaussNs) [5]. The GaussNs is a kind statistical noise that follows Gaussian probability density and included in the image at the time when the image is captured. Local averaging operations (like mean filter, Gaussian filter, and so on) are the broadly acknowledged methods for the GaussNs removal [5].

Gaussian filter is a well known technique for GaussNs expulsion; nonetheless, this filter tends to blur edges which may bring about loss of information in some visually important areas. To take care of this issue Tomasi et al. [19] proposed bilateral filter (BFlt) that utilizes weights taking into account radiometric and spatial symmetry. The respective filter proposed in [19] has ended up being extremely helpful; its downside is high computational complexity. To overcome this issue Paris et al. [11] proposed a quick estimate of the BFlt; this is based on linear interpolation using standard signal processing. Buades et al. [1] proposed NL-means algorithm for evacuation of GaussNs, this method depends on non-local averaging of all pixels in the image. Despite the fact that NL-means algorithm creates better results, in any case it requires fundamentally more computation when contrasted with beforehand mentioned strategies, its execution relies on upon the earlier detection of the noise parameter, i.e., we require either exact or approximate value of noise parameter (prior information of measure of exact noise available in the corrupted image).

Impulse noise (ImNs) is other type of noise that can affect the image in its transmission and portrayed by changing a few pixels with noise while holding the rest [12]. The GaussNs removal strategies talked about so far are not ready to remove this type of noise viably. To take care of this issue, nonlinear filters have been proposed. The most straightforward and exceptionally effective method to expel impulse noise is the median filter (MedFlt). However, the MedFlt has a tendency of altering uncorrupted pixels of a given noisy image. To take care of this issue a number of expansions of MedFlt have been proposed, few of such expansions are discussed in [10, 13, 16, 17, 21]. These switching strategy first distinguish pixels that are corrupted by ImNs and afterward replace them with assessed values while keeping the rest of the pixels unaltered. As these strategies are an extension to MedFlt, consequently they can bring about some image fine details to be twisted. This issue is successfully explained by fuzzy procedures, few of such procedures are discussed in [3, 8, 23]. The execution of these fuzzy filters varies in as per the efficiency of noise detectors.

In [5], Garnett et al. proposed ROAD statistics for recognizing the pixels that are affected by ImNs. Garnett et al. [5] utilize this statistics into a trilateral filter (TrFlt) to evacuate ImNs. This filter has turned out to be better ImNs locator and produces phenomenal results notwithstanding when the noise substance is high. Later Dong et al. [4] changed ROAD and proposed a ROLD statistics. This method got better exhibitions yet it requires more calculations than ROAD. Yu et al. [24] proposed a RORD statistic. This technique uses a reference image in order to detect noisy and non-noisy pixel.

Wu etal. [22] developed a fuzzy parameterized non-local averaging filter to remove random-valued ImNs. Wu et al. [22] introduce a new fuzzy weighting function, which reduces the impulsive weight efficiently, to the non-local means. Zhu et al. [27] present a two-step random-valued ImNs removal method based on local deviation index (LDI) and edge-preserving regularization. Saxena [15] proposed a two-phase algorithm efficient for decreasing random-valued ImNs with the help of basis splines interpolation. Gellert et al. [6] proposed ‘context-based prediction filtering of impulse noise images’ (CBPF); this algorithm replaces the noisy pixel with the value occurring with the highest frequency, in the same context as the replaceable pixel. Since it is a context-based technique, it preserves the details in the filtered images better than other methods.

Chen et al. [2] proposed directional absolute relative differences (DARD) statistic. This method is capable in removing high quality ImNs from image without distorting image details. Chen et al. [2] have stated that their method has less computational complexity than many other MedNs filters. Few other algorithms for the removal of GaussNs have been developed recently; such as in [18], Talebi et al. proposed a method for global image denoising. In [28], Zuo et al. presented a gradient histogram preservation (GHP) model for image denoising; this method is able to preserve texture information in the restored image. Knaus et al. [9] developed an algorithm to remove the GaussNs, this algorithm assumes image denoising as a physical process.

In this work we develop a new statistic for high quality ImNs removal named “maximum absolute relative differences” (MARD). The proposed method uses maximum difference value to detect noisy and non-noisy pixels. Experimental results show that proposed statistics works better than DARD and others.

The organization of this work is as follows. Section 2 shows abbreviations of words and notations that we are using in our work. In Sect. 3 we briefly review DARD statistics. Section 4 describes about our newly created MARD statistics. Section 5 shows, how to incorporate our statistics into the BFlt to create two new BFlt for GaussN and ImNs, respectively, and a new TrFlt for MxdNs. In Sect. 6, we provide the simulations on noise detection and noise removal with visual examples and numerical results. Finally Sect. 7 concludes proposed work.

2 Abbreviations

In this Sect. Table 1 contains a list of abbreviations and notations that are used by us in this work.

Table 1 Abbreviations and notations

3 Directional Absolute Relative Differences

Before introducing proposed MARD statistic, we would like to give a brief overview of DARD statistic [2]. The DARD statistic only focuses on the edge information in the four main directions as it is shown in Fig. 1 (source [2]). Let \(D_m\) (m = 1 to 4) are set of co-ordinates that the current patch has.

Fig. 1
figure 1

Four directions for noise detection in a \((2U+1)\times (2U+1)\) window (U=2 for example)

Here authors [2] introduce \(I^\mathrm{ref}\) that contains edge information of the original image from the image contaminated with noise. Now for each direction, authors [2] defined \({d}^{m}_{i,j}\) as the addition of whole absolute differences of gray-level intensity values between neighbors of \(I^\mathrm{ref}\) and its centered pixel in (ij). Now \({d}^{m}_{i,j}\) is given as:

$$\begin{aligned} d^{m}_{i,j} = \sum _{(p,q) \in D_m} \left| I^\mathrm{ref}_{i+p,j+q} - I_{i,j}\right| , m = 1 \sim 4, \end{aligned}$$
(1)

next authors ([2]) define \(g^{m}_{i,j}\) as the addition of all differences in mentioned direction in the \(I^\mathrm{ref}\) as:

$$\begin{aligned} g^{m}_{i,j} = \sum _{(p,q) \in D_m} \left| I^\mathrm{ref}_{i+p,j+q} - I^\mathrm{ref}_{i,j}\right| , m = 1 \sim 4, \end{aligned}$$
(2)

then define an DARD statistic for each direction as follows:

$$\begin{aligned} \mathrm{DARD}^{m}_{i,j} = \left| d^m_{i,j} - \alpha g^m_{i,j}\right| , \quad m = 1 \sim 4, 0 \le \alpha \le 1, \end{aligned}$$
(3)

here for simplicity authors ([2]) suggest \( \alpha = 0.5\). Finally, the DARD statistic is defined as:

$$\begin{aligned} \mathrm{DARD} = \mathrm{min}(\mathrm{DARD}^1, \mathrm{DARD}^2, \mathrm{DARD}^3, \mathrm{DARD}^4). \end{aligned}$$
(4)

Finally, to take decision that whether a pixel is corrupted with ImNs or not; a threshold is used which says that if \(\mathrm{DARD}_{i,j} > T\) then \(I_{i, j}\) contains ImNs, otherwise it is noise free [2].

4 MARD Statistic for Detecting ImNs

The DARD is as of now a decent statistics [2]. Nonetheless, we observed that for a window of size \((2U+1)\times (2U+1)\), DARD does not consider \(4{U}^{2}-4U\) pixels and this value is substantial for \(U \ge 3\). These \(4{U}^{2}-4U\) pixels may influence the general execution of any impulse detector. In our work we build up another impulse detector statistics which considers all pixels in a window of size \((2U+1)\times (2U+1)\), we likewise watch that as opposed to figuring \(d^{m}_{i,j}\) and \(g^{m}_{i,j}\) in the way it is computed in DARD, even maximum value of absolute difference can be a decent measure to recognize whether a given pixel is noisy or not. The proposed statistics depends on taking after two presumptions.

  • Uncorrupted images have locally smoothly varying areas which is separated by edges of image [17].

  • Either smaller or larger values are taken by noisy pixels than their neighborhoods [25, 26].

The proposed impulse detector considers all pixels of \((2U+1)\times (2U+1)\) size window. At first for a patch of size \((2U+1)\times (2U+1)\) centered at (ij) we define \({\widehat{d}_{i,j}}\) as the largest value of among all absolute differences of gray-level values between neighbors in \(I^\mathrm{ref}\) and its centered pixel in I as:

$$\begin{aligned} \widehat{d}_{i,j} = \text {max} \left\{ \left| I^\mathrm{ref}_{i+p,j+q} - I_{i,j}\right| \right\} \qquad p,q \in [-U, 0] \bigcup [0, U], \end{aligned}$$
(5)

we define \(\widehat{g}_{i,j}\) as the largest value among all absolute differences of gray-level values between neighbors in \(I^\mathrm{ref}\) and its centered pixel in \(I^\mathrm{ref}\) as:

$$\begin{aligned} \widehat{g}_{i,j} = \text {max} \left\{ \left| I^\mathrm{ref}_{i+p,j+q} - I^\mathrm{ref}_{i,j}\right| \right\} \qquad p,q \in [-U, 0) \bigcup (0, U], \end{aligned}$$
(6)

Finally the MARD statistic is defined as:

$$\begin{aligned} {\mathrm{MARD}_{i,j}} = |\widehat{d}_{i,j} - \widehat{g}_{i,j}| \,. \end{aligned}$$
(7)

It is clear that unlike ROLD and DARD, the proposed MARD does not have any dependency on \(\alpha \), it just depends on \({\widehat{g}_{i,j}}\) and \({\widehat{d}_{i,j}}\).

5 The Proposed Method

We are defining a new weighting function named \(w^{N}_{G}\), this weighting function is calculated as follows.

$$\begin{aligned} w^{N}_{G}(i, j) = {e^{-{{G^{N}}(i,j)}^{2}/2{\sigma }^2_G}}, \end{aligned}$$
(8)

where \({G^{N}}(i,j)\) is calculated using the proposed edge detector operator. To calculate value of \({G^{N}}(i,j)\), in an image I, we consider its all \(3\times 3\) patches, then for a given patch centered at (ij) value of \({G^{N}}(i,j)\) is defined as follows:

$$\begin{aligned} G^{N}(i,j) = | I_{i,j} - \text {min}\{ I_{i+a,j+b} \}|, \qquad a,b \in [-1, 0] \bigcup [0, 1]. \end{aligned}$$
(9)
Fig. 2
figure 2

Results of proposed edge detector operator in comparison with the Sobel operator, here a original Lena image, b result of the Sobel operator, c result of proposed edge detector operator, d Lena image corrupted from SNP noise, e result of the Sobel operator for image of \(\{(\mathbf d )\}\) and f result of the proposed edge detector operator for image of \(\{(\mathbf d )\}\)

It is clear from Fig. 2 that proposed edge detector operator detects all clear edges as compared to the Sobel operator and unlike the Sobel operator it does not require complex calculations for processing. Now based on this new weighting function and MARD statistic the proposed filters are defined as follows:

  • MSG-BF This filter is capable in removing GaussNs from image, it is described as follows:

    $$\begin{aligned} \widetilde{I}_{i,j} = \frac{ \sum _{x=-U}^{U} \sum _{y=-U}^{U} w_{S}(x,y) w^{N}_{G}(x,y) I_{x+i, y+j} }{ \sum _{x=-U}^{U} \sum _{y=-U}^{U} w_{S}(x,y) w^{N}_{G}(x,y)}. \end{aligned}$$
    (10)
  • MARD-BF This filter is capable in removing ImNs from image, it is described as follows:

    $$\begin{aligned} \widetilde{I}_{i,j} = \frac{ \sum _{x=-U}^{U} \sum _{y=-U}^{U} w_{S}(x,y) {w'}_{I}(x,y) I_{x+i, y+j} }{ \sum _{x=-U}^{U} \sum _{y=-U}^{U} w_{S}(x,y) {w'}_{I}(x,y)}. \end{aligned}$$
    (11)
  • SG-MARD-TRIF This filter is capable in removing both GaussNs and ImNs, it is described as follows:

    $$\begin{aligned} \widetilde{I}_{i,j}= \frac{ \sum \sum w_{S}(x,y) w^{N}_{G}(x,y) {w'}_{I}(x,t) I_{x+i, y+j} }{ \sum \sum w_{S}(x,y) w^{N}_{G}(x,y) {w'}_{I}(x,y)}. \end{aligned}$$
    (12)

Here outer and inner \(\sum \) are having ranges as \(x=-U\) to U and \(y=-U\) to U, respectively. The weights \(w_S\) and \({w'}_I\) (for MSG-BF, MARD-BF, SG-MARD-TRIF) are defined as: \(w_{S}(i, j) = e^{-({{(i-x)}^2 +{(j-q)}^2)/2{\sigma }^2_S}}, {w'}_{I}(i, j) = {e^{-{\mathrm{MARD}(i,j)}^{2}/2{\sigma }^2_I}}.\)

5.1 Denoising Algorithm

In the proposed algorithm, the \(I^\mathrm{ref}\) plays a significant role. A satisfactory \(I^\mathrm{ref}\) can be obtained by using a two-step algorithm. Initially we generate reference image using MedFlt and from the next step; previously generated restoration result is used as \(I^\mathrm{ref}\). The proposed algorithm to generate a required \(I^\mathrm{ref}\) is as follows.

figure a
figure b

Next we are giving our algorithm used for image denoising. In Fig. 3, we are showing mean MARD values for Lena and barbara images. Here these values are shown for different levels of SNP noise.

Fig. 3
figure 3

Mean MARD values for two images corrupted with different level of SNP noise, a for barbara image and b for Lena image

5.2 Comparison of MARD with RORD

In this section we are giving a situation where the RORD ([24]) fails to detect noisy pixel in an image patch (patch used here is taken from work of [2]). This patch is shown in Fig. 4, in this patch centered pixel is uncorrupted and its neighbors are corrupted with ImNs.

Fig. 4
figure 4

A situation where RORD fails. In this patch centered pixel is uncorrupted and its neighbors are corrupted with ImNs

5.3 Comparison of MARD with DARD

Here we are comparing performance of our MARD statistic with DARD. Now in this case, we are showing our results on a patch of Lena image. See Fig. 5 for better understanding.

Fig. 5
figure 5

A patch {location (299, 172)} of Lena image, here image is corrupted by ImNs

In Fig. 5 we are demonstrating image of Lena ruined with ImNs, in this image we have denoted a small patch and we are demonstrating its content at base of the Figure. In the given patch consider its inside window of size \(7\times 7\), in this window of more than 50% of pixels of centered pixel are corrupted with ImNs (corrupted pixels are appeared in red color). Next we are demonstrating consequences of DARD and MARD statistics on this patch keeping in mind the end goal to identify noise pixels.

From Fig. 6, it is clear that for a center uncorrupted pixel, having few of its neighbors corrupted with noise both MARD and DARD are able to detect noisy and noise-free pixels, and this leads to a conclusion that we can use MARD statistic to detect noisy pixels in situations where the image is corrupted with heavy ImNs.

Fig. 6
figure 6

Comparison of MARD with DARD in detection of noisy pixels, here original image patch shows pixel values of lena image in a \(9\times 9\) patch starting from location (299, 172); a original image patch, b same patch after addition of noise, c result of \(3\times 3\) MF, d result of DARD statistic and e result of proposed MARD statistic

6 Simulations

We evaluate performance of proposed filters with state-of-the-art. For simulation we use several \(512\times 512\) gray scale standard test images corrupted with GaussNs, SNP noise, random-valued ImNs, and MxdNs. For illustrations, the results for images ‘barbara’, ‘baboon’, ‘cameraman’, ‘elaine’, ‘fingerprint’, ‘house’, ‘Lena’, ‘man’ and ‘peepers’ are presented here. Figure. 7 shows denoising results by various methods on the famous barbara image.

Fig. 7
figure 7

Denoising results, here image is corrupted with GN, a barbara image, b image corrupted with GaussNs \(\sigma = 40\), c BFlt result, d gaussian filter result, e MedFlt \(3\times 3\) result, f MedFlt \(5\times 5\) result, g SG-BF filter result, h MSG-BF filter result

Based on results of Fig. 7, it is clear that proposed MSG-BF filter is able to remove high amount of GaussNs from a given noisy image without affecting its edge details. In MSG-BF filter we are using our newly proposed edge detector operator which does not require complex calculations like the Sobel operator and hence it is clear that our MSG-BF filter requires less computation then SG-BF filter.

Fig. 8
figure 8

Denoising results, here image is corrupted with SNP noise, a baboon image, b image corrupted with SNP noise with \(p=20\%\), c MedFlt \(3\times 3\) result, d MedFlt \(5\times 5\) result, e DARD-BF BFlt result, f MARD-BF BFlt result and g CBPF result

Based on results of Fig. 8 we observe that proposed MARD-BF filter is able to remove SNP noise from given image without disturbing its other visual details, also proposed filter does not affect edge information of given image.

Fig. 9
figure 9

Denoising results, here image is corrupted with MxdNs, a baboon image, b image corrupted with MxdNs with \(p=60\%\) and \(\sigma =10\%\), c MedFlt \(3\times 3\) result \(\{\mathrm{PSNR}=11.9193\}\), d MedFlt \(5\times 5\) result \(\{\mathrm{PSNR}=18.2158\}\), e SG-DARD-BF TrFlt result \(\{\mathrm{PSNR}=18.7442\}\), f SG-MARD-BF TrFlt result \(\{\mathrm{PSNR}=23.0808\}\) and g CBPF result \(\{\mathrm{PSNR}=19.8886\}\)

From Fig. 9, it is clear that proposed SG-MARD-BF filter produces better results than SG-DARD-BF filter. However, it is not able to produced visually better results than CBPF method. It is also clear from Fig. 9 that SG-MARD-BF and CBPF are producing results that look more natural than other denoising filters; this is because these filters are able to preserve information and detailing of edges in the processed image even when the noise contents in the noisy image are very high. However, CBPF method is not able to minimize mean squared error in between input and processed image and hence it has comparatively less value of PSNR than SG-MARD-BF filter.x

6.1 Selection of Parameters

The proposed algorithm has three parameters which are, \({\sigma }_G\) (for controlling gradient weight) \({\sigma }_S\) (for controlling spatial weight) and \({\sigma }_I\) (for controlling MARD weight), by experimenting on large set of images we found optimal values for these parameters as: \({\sigma }_G\in [1.0, 2.0]\) for all kinds of noise. \({\sigma }_I\in [0.09, 0.6]\) for salt and pepper noise and \({\sigma }_I \in [0.05, 0.1]\) for random-valued ImNs. \({\sigma }_S\in [0.8, 3.0]\) for GaussNs and \({\sigma }_S \in [2.4, 3.0]\) for others. By hidden and trials; parameter T is set as \(T \ge 0.01\) and \(T\le 0.10\) with a larger value for SNP noise but a lower one for random-valued ImNs and GN.

6.2 Noise Removal and Noise Detection Results

This section shows performance of proposed filter in removal and detection of noise from given noisy images. At first we will explain about image noise and its model. Image noise is generally a part of electronically generated noise, which causes an image to have irregular variety in color information, texture information and brightness. Images are contaminated with noise decrease in the capacity of eyewitness in understanding the image. By and large the image noise model is considered as:

$$\begin{aligned} g(x, y) = f(x, y) + {\eta }(x, y), \end{aligned}$$
(13)

Aim of all denoising method is to estimate a \(\hat{f}\) from the given g based on some prior knowledge about \(\eta \). The \(\hat{f}\) is assumed to be of better quality if the \(\hat{f}\rightarrow f\). Now from equation (13) it is clear that \(g-\hat{f}\) will give us an approximation of amount of noise removed via image restoration and \(f-\hat{f}\) will give us an approximation of amount of noise left in the image after image restoration. In Fig. 10 we are showing amount of noise left in image after image restoration.

Fig. 10
figure 10

Restoration results of various methods including proposed method for barbara image, B-a original image, B-b noisy image corrupted with GaussNs with \(\sigma = 40\), B-c restoration result of BFlt, B-d restoration result of the Gaussian filter, B-e restoration result of MedFlt \(3\times 3\), B-f restoration result of MedFlt \(5\times 5\), B-g restoration result of SG-BF and B-h restoration result of proposed method. For amount of noise left in the restored image B-c’ result of BFlt, B-d’ result of the Gaussian filter, B-e’ result of MedFlt \(3\times 3,\) B-f’ result of MedFlt \(5\times 5,\) B-g’ result of SG-BF and B-h’ result of proposed method

In view of consequences of Fig. 10, unmistakably every of the algorithms can distinguish (detect) noise from given noisy image. A profound observation of Fig. 10 demonstrates that end results of SG-BF method contain some information about edges of given noisy image, which basically demonstrates that this algorithm is removing some edge image alongside noise. Taking into account equation 13, in actuality, circumstances, we don’t have any information about presence of the (f), consequently it is practically difficult to measure amount of noise left in the restored image after image restoration. The down to earth approach to check efficiency of any technique is by subtracting g from f. This will give us an estimation of the amount of noise is expelled from g by the restoration method. This specific result is appeared in Fig. 11. A profound perception of Fig. 11 demonstrates that proposed strategy can remove high amount of GaussNs from given image without much influencing other visual information.

Fig. 11
figure 11

Restoration results of various methods including proposed method for barbara image, B-a original image, B-b noisy image corrupted with GaussNs with \(\sigma = 40\), B-c restoration result of BFlt, B-d restoration result of the Gaussian filter, B-e restoration result of MedFlt \(3\times 3\), B-f restoration result of MedFlt \(5\times 5\), B-g restoration result of SG-BF and B-h is restoration result of proposed method. For amount of noise removed from the noisy image B-c’ result of BFlt, B-d’ result of the Gaussian filter, B-e’ result of MedFlt \(3\times 3,\) B-f’ result of MedFlt \(5\times 5,\) B-g’ result of SG-BF and B-h’ is result of proposed method

6.3 Limitation of PSNR

Quality of restored signal is measured using PSNR. Large value of PSNR shows that the restoration is of better quality. One weakness of PSNR is that it depends on MSE and MSE measure depends on scaling of variables despite the fact that the image is invariant to scaling. This can be explained from Fig. 12 (source [20]), where in many aspects images are different from each other, still they have same MSE values.

Fig. 12
figure 12

Shows the limitation of MSE a original image, b degraded image \(\{\mathrm{MSE}=144,\quad \mathrm{SSIM}=0.998 \}\), c degraded image \(\{\mathrm{MSE}=144,\quad SSIM=0.913 \}\), d degraded image \(\{\mathrm{MSE}=144,\quad \mathrm{SSIM}=0.840 \}\), e degraded image \(\{\mathrm{MSE}=144,\quad \mathrm{SSIM}=0.694 \}\), f degraded image \(\{\mathrm{MSE}=142,\quad \mathrm{SSIM}=0.662 \}\)

It is clear from Fig. 12 that MSE produces similar values even after the image does not have same structural similarity. Hence to evaluate efficiency of proposed filters, we are using SSIM and COR.

6.4 Structure Similarity Index Measure (SSIM)

The SSIM is used to measure structural similarity between two images. Mathematical equation to calculate SSIM between 2 images x and y is:

$$\begin{aligned} \mathrm{SSIM}(x,y) = \frac{(2\mu _{x}\mu _{y} + c_{1})(2\sigma _{xy} + c_{2})}{ \left( {\mu ^2}_{x} + {\mu ^2}_{y} + c_{1}\right) \left( {\sigma ^2}_{x} + {\sigma ^2}_{y} + c_{2}\right) }, \end{aligned}$$
(14)

here different parameters are given values according as suggested by [20].

6.5 Correlation (COR)

Two-dimensional correlation (COR) between 2 images X and Y, having size \(N_1{\times }N_2\) is defined as:

$$\begin{aligned}&\mathrm{COR} = \nonumber \\&\quad \frac{\sum _{i=1}^{N_1} \sum _{j=1}^{N_2}(X_{i,j}-X_M)(Y_{i,j}-Y_M)}{\sqrt{\left( \sum _{i=1}^{N_1} \sum _{j=1}^{N_2}(X_{i,j}-X_M)^2\right) \left( \sum _{i=1}^{N_1} \sum _{j=1}^{N_2}(Y_{i,j}-Y_M)^2\right) }}, \end{aligned}$$
(15)

where \(X_{i,j}\) and \(Y_{i,j}\) denote the pixel intensities of the restored image and the uncorrupted image, respectively, \(X_M\) and \(Y_M\) denote mean intensity value of corresponding image. In general larger value signifies better image restoration. In Table 2 we are showing average results of COR and SSIM for given set of images \(\{\) ‘baboon’, ‘barbara’, ‘cameraman’, ‘elaine’, ‘fingerprint’, ‘house’, ‘Lena’, ‘man’, ‘peepers’ \(\}\). Here images are corrupted with high amount of SNP noise in the range \(p \in \{ 40, 50, 60 \}\) and MxdNs in the range \(\sigma =10\) with \(p \in \{ 40, 50, 60 \}\). Based on experimental results of DARD with various other existing filters, Chen et al. [2] have concluded that their method works better in removing GaussNs and MxdNs as well as in removing ImNs than many other existing methods. Now based on results of Table 2, we conclude that proposed filters work better than DARD and CBPF [6] and hence it is an effective choice for image restoration. For CBPF method we have used parameter settings as: \(\mathrm{CS}=3, \mathrm{SR}=4, T=500\); these values are found as being the best in the article [6]. For the calculation of A-COR and A-SSIM; the test images are taken in the gray-level intensity range [0, 1].

Table 2 Average COR and SSIM for images corrupted with SNP noise

6.6 Noise Detection Result Using Classification Rate

In Fig. 6, we have indicated experimental results of proposed MARD statistics in recognition of noisy pixels for an image patch. Here we will demonstrate average results of MARD in identification of noisy pixels. We assume that in a given noisy image, we definitely know locations of every noisy pixel. Presently the pixels of an image can be assembled into 2 sets: the noisy pixel set and the noise-free pixel set. Any noise detector would be of better quality on the off chance that it can distinguish a large portion of the noisy pixels and noise-free pixels. Additionally its CR ought to be as high as could be allowed. In general the CR is defined as: \(\mathrm{CR} = \frac{n_1}{N} + \frac{n_2}{N},\) where N is size of the image. In Table 3 we are showing average results of CR for given set of images \(\{\) ‘baboon’, ‘barbara’, ‘cameraman’, ‘elaine’, ‘fingerprint’, ‘house’, ‘Lena’, ‘man’, ‘peepers’ \(\}\), here images are corrupted with SNP noise in the range \(p\in \{ 60, 70 \}\). Despite the fact that DARD is best strategy for noise removal in the accessible writing [2], However, for a given \((2U+1)\times (2U+1)\) window DARD does not consider \(4{U}^{2}-4U\) pixels. These \(4{U}^{2}-4U\) pixels may influence overall performance of any noise detector. Some of the time it might happen that DARD identifies less uncorrupted edge pixels as corrupted pixels, this prompts lower CR values. From Table 3 obviously; on a normal proposed MARD measurement can identify more number of noisy pixels than DARD and CBPF [6].

Table 3 Average CR for images corrupted with SNP noise

6.7 Computational Complexity Analysis

In this section we have shown a step-by-step computational complexity analysis of DARD ([2]) and MARD methods. Both methods are combination of different weighting functions; hence, we are showing computational complexity of different weighting functions only. For this we have assumed image size as \(n{\times }n\) and \(a=(2U+1)\times (2U+1)\). We have also assumed that all single-line statements take \(\mathcal {O}(1)\) (constant) time in execution (Table 4).

Table 4 Computational complexity analysis of DARD and MARD

So the total computational complexity of DARD and MARD methods is \(O({a^2}{n^2})+O({{a}{\cdot }n^2})+O({{a}{\cdot }n^2})+O({n^2})\) and \(O({a}{n^2})+O({{a}{\cdot }n^2})+O({{a}{\cdot }n^2})+O({n^2})\), respectively. If we drop the lower order terms then the computational complexity of DARD and MARD methods is \(O({a^2}{n^2})\) and \(O({{a}{\cdot }n^2})\), respectively. This clearly shows that MARD is computationally ‘a’ times efficient than DARD method.

6.8 Contribution of The Proposed Work

The main contributions of the proposed work are as follows:

  1. 1.

    The MARD statistics considers all the pixels of a patch size and hence it is more accurate than the DARD [2] method.

  2. 2.

    Also the MARD method is not dependant on \(\alpha \).

  3. 3.

    The MARD successfully detects pixels in the cases where RORD [24] fails.

  4. 4.

    The MARD is not sensitive to the edge information of the image.

  5. 5.

    The MARD is computationally more efficient than DARD [2].

7 Conclusion

As described in this paper, the filters available in the literature are able to reduce noise contents from given corrupted image; however, they are computationally expensive. We proposed a statistic termed as MARD and modified SG. The proposed MARD statistic shows how impulse-like a pixel; in the sense that the larger the impulse, the larger the MARD value. Modified SG is used as weighting function for BFlt. Using MARD and modified SG we design a TrFlt which is efficiently able to remove the GaussNs and MxdNs as well as ImNs. To show the efficiency of the proposed filter we conduct few experiments and compare our results with the results of DARD and others. These comparisons are both quantitative and qualitative in nature and their results are shown in different figures and tables. These experimental results show that the proposed method is able to reduce GaussNs and MxdNs as well as ImNs more accurately than DARD and others.