Skip to main content

Improved preclassification non local-means (IPNLM) for filtering of grayscale images degraded with additive white Gaussian noise

Abstract

In this paper, we develop an extensive research on different types of grayscale images applying standard non local (NL)-means algorithm on different search and patch windows sizes to obtain optimal parameters where the values of criteria peak signal-to-noise ratio (PSNR), mean absolute error (MAE), and structural similarity index (SSIM) would be the best possible. The research shows quantitatively the importance on the appropriate selection of the windows sizes used during the filtering process. Based on the optimal parameters of the standard NL-means, we propose the improved preclassification non local-means (IPNLM) for filtering grayscale images degraded with additive white Gaussian noise (AWGN). The proposal uses a descriptors evaluation for each search window in the noisy image to apply statistical neighborhood preclassification respect to the homogeneity of each window to distinguish whether the current noisy pixel is in a homogeneous region or it is in an edge object region. Also, two thresholds based on the standard deviation of the local region in the noisy image are proposed to classify the pixels and perform a filtering level degree providing a commitment between the image denoising and the processing time. The proposal IPNLM reveals good results outperforming other filters based on NL-means by balancing the tradeoff between the noise suppression, detail preservation, and processing time. Experimental results demonstrate that IPNLM algorithm can reduce considerably the processing time from 8 through 15 times in comparison with the standard NL-means and other analyzed filters.

1 Introduction

Noise is a common problem in digital images; it is usually incorporated when the images are acquired or transmitted through the communication channels. Considering that the noise is inherent in all the images, i.e., low light and poor visibility; it is essential to carry out the improvement, preservation, and noise removal to obtain less degraded images to be analyzed and to develop computer vision applications.

Several filtering methods are mainly focused on noise smoothing, preserving inherent characteristics in the images. Although, one of the most important algorithms found in the scientific literature is the non local (NL)-means developed by Buades [1], which is used in many scientific applications until today [2,3,4,5]. This algorithm estimates a denoised pixel as the weighted average of the entire image pixels; the weights exponentially decay in dissimilarities between the local neighborhood of the current pixel and each local neighborhood of the surrounding pixels.

The NL-means gets better results than others local smoothing filters in terms of the mean square error (MSE) criterion [6], emphasizing the fact that a small MSE does not guarantee a good visual quality in the restored image [1]. The novelty of this idea has attracted the interest of many researchers that are looking to improve the computational efficiency and image restoration of this algorithm using better similarity measures [7] and adaptive local neighborhoods [8]. Other researchers proposed algorithmic acceleration techniques [7, 9], the FFT-based computation of the neighborhood similarities [9], and the multiscale methodology of the pull-push scattered data interpolation method [10] to improve the NL-means. Enming Luo et al. [11] incorporated noise dependence into the weight function of NL-means and propose two process stages providing better denoising effect. Dixit and Phadke [12, 13] proposed a local adaptive filtering method that can track the noise variance during the NL-means estimation process and after applying a local denoising filtering method in those particular areas with remaining noise.

Kaihua Gan et al. [14] introduced a modification in the NL-means based on edge detection by using the improved Sobel operator where the result is feedback and used to improve the weight function parameter. To enhance the weight function in the NL-means, V. Bruni et al. [15] embedded the structural similarity index (SSIM) criterion in place of the L2 norm and a further refinement of the denoising results can be performed in the denoised image by using the Wiener filter in both the denoised and its respective residual images. Rushi Lan et al. [16] considered the weights as fuzzy variables; these were determined by solving an energy minimization problem; also, they introduce a new exponential parameter to fuzzify the weights to map them in a proper space.

For the search windows size, Verma and Pandey [17] proposed an algorithm to select the optimal search window size for each pixel using values based on the gray scale magnitude differences, which describes the local characteristics of the region. Jing Wang et al. [18] introduced a method that adaptively adjust the filter parameters in concordance to the content of different image patch, building a prediction function, used to compute optimum parameters.

Considering the literature survey, we assume that there are two ways to establish the window sizes; one is select the values proposed by previous authors or evaluate experimentally different sizes and choose the one that best suits the particular needs. So, it was developed an extensive research on 150 different grayscale images to assess the standard NL-means algorithm behavior on different search and patch windows sizes to obtain the optimum parameters where the values of the peak signal-to-noise ratio (PSNR), mean absolute error (MAE), and SSIM criteria yield the best results. This research shows quantitatively the importance on the appropriate selection of the window sizes used during the filtering procedures. Based on the optimal windows size parameters found in the evaluation of the standard NL-means, we propose the improved preclassification non local-means algorithm (IPNLM) for denoising grayscale images degraded with additive white Gaussian noise (AWGN). The proposal employs a descriptors evaluation for each search window in the noisy image to bring about neighborhood preclassification according to the homogeneity of each window, wherewith distinguish if the current noisy pixel is located either in a homogeneous region or in an edge object region. A criterion value based in two thresholds is proposed to perform a filtering level. In this way, the pixels are classified using the value given by the standard deviation of the local region in the noisy image providing thereby a commitment between the image denoising and the processing time. The performance results reveal that the proposed IPNLM algorithm outperforms the standard NL-means and other filters based on NL-means by balancing the tradeoff between noise suppression, fine detail preservation, and processing time. Experimental results demonstrate that the proposed IPNLM approach can reduce considerably the processing time from 8 through 15 times in comparison with the standard NL-means.

The paper structure is organized as follows: in Section 2.1 is explained the standard NL-means algorithm. In Section 2.2 is shown the simulation experiments to find optimal parameters for the standard NL-means. In Section 2.3 is presented the proposed IPNLM algorithm and its filtering performance in comparison with different NL-means based filters. In Section 3 are set out the results and its discussion. Finally, the conclusions are given in Section 4.

2 Methods/experimental

2.1 Standard NL-means algorithm

The NL-means filter is a denoising algorithm whose particularity lies in the computation of a pixel value based on a nonlocal similarity averaging of all pixels in the image. This reduces the loss of the details in the filtered image [1, 19].

The standard algorithm can be described as follows: consider a noisy image defined on a discrete grid I given a discrete noisy image u = {u(i)|iI}. Then, the estimated NL-means value NL(u(i)) for a pixel i is computed as a weighted average of all the pixels in the image,

$$ NL\left(u(i)\right)=\sum \limits_{j\in I}w\left(i,j\right)u(j), $$
(1)

where {w(i, j)} is a family of weights that depends on the similarity between the pixels i and j, and satisfies the usual conditions 0 ≤ w(i, j) ≤ 1 and ∑jw(i, j) = 1. This similarity is based on the magnitude correspondence of the gray levels neighborhoods u(Ni) and u(Nj), where Nk denotes an odd square neighborhood of fixed size and centered at pixel k.

The similarity measure is a decreasing function of the squared weighted Euclidean distance \( {d}^2=\frac{1}{3{\left(2f+1\right)}^2}{\left(u\left({N}_i\right)-u\left({N}_j\right)\right)}^2 \) of the patches centered respectively at i and j of the radius size determined for {(2f + 1)| f}. Therefore, the pixels with a similar neighborhood to Ni have larger weights in the average weights. These weights are defined as,

$$ {w}_{ORI}\left(i,j\right)=\frac{e^{-\frac{\frac{1}{3{\left(2f+1\right)}^2}{\left(u\left({N}_i\right)-u\left({N}_j\right)\right)}^2}{h^2}}}{\sum \limits_j{e}^{\frac{\frac{1}{3{\left(2f+1\right)}^2}{\left(u\left({N}_i\right)-u\left({N}_j\right)\right)}^2}{h^2}}}, $$
(2)

where wORI is defined as the original weight function, \( \sum \limits_j{e}^{-\frac{\frac{1}{3{\left(2f+1\right)}^2}{\left(u\left({N}_i\right)-u\left({N}_j\right)\right)}^2}{h^2}} \) is the normalizing constant, and the parameter h controls the filtering level through the decay of the exponential function and therefore the decay of the weights as a function of the Euclidean distances.

Because of the flexibility of the NL-means, Buades [20] published an improvement to this algorithm, in which the weight function is modified in the manner of it is set to the average similar patches up to noise. So, the similarity windows with quadratic distances smaller than 2σ2 are fixed to one, while for larger distances decrease rapidly according to the exponential kernel. The improved weight function wIPOL is given as follows [20],

$$ {w}_{IPOL}\left(i,j\right)=\frac{e^{-\left(\frac{\left(\max \left({d}^2-2{\sigma}^2,0\right)\right)}{h^2}\right)}}{\sum \limits_j{e}^{-\frac{\left(\max \left({d}^2-2{\sigma}^2,0\right)\right)}{h^2}}} $$
(3)

According to Buades et al. [1], the size of the search window should be the same size of the whole image; however, this is costly computationally. So, due to computational purposes, the search of similar windows can be restricted to a search window of the radius size determined for {2t + 1| t}, where the value t is defined by the user; in this way, it is not necessary to cover all the pixels of the image considering only those that are inside of this radius. Generally, authors select the window sizes in two ways: experimentally according to the best results obtained for tested images or setting up the values provided in the table obtained from Buades et al. [20].

2.2 Optimal parameter values for the NL-means

There are initial parameters that must be established in the NL-means algorithm, such as filtering level, similarity window (patch), search window, and weight function. So, one of the purposes of this paper is to provide an evaluation to find the parameters where the NL-means works optimally for diverse types of images in terms of the PSNR and MAE criteria, additionally is suggested the use of the SSIM as human visual system (HVS) metric to complement the research. These criteria were selected because they are the most typically and extensively tested quality metrics to evaluate several image processing applications.

We performed evaluations in a set of 150 different images: from the Berkeley database [21], video sequences frames, and images commonly evaluated on denoising; all of them present natural noise and artifacts.

In order to find the optimal parameters to be used in different scenarios, the standard NL-means algorithm was implemented, presenting several parameters to be modified. We decided to establish some fixed conditions like σ = 10, h = 10 to vary others ast = {6,  8,  10,  14,  17,  19}, f = {1,  2,  3,  4,  5,  6}, and w = {wORI, wIPOL}, carrying out the combinations between these parameters obtaining 72 different cases for each test image. We decide to select noise level as 10 considering that this is a typical initial research value [14,15,16]. Quality metrics as the PSNR [22], the MAE [6], and the SSIM [23] were calculated; additionally, to measure computational performance, the processing time (time) is included. For σ = 10, the values of the patch of 3 × 3 pixels and the search window of 21 × 21 pixels were taken from the table provided in [20] and the filtering level h was considered as the same value of the standard deviation σ of the noise level, as was suggested in [2].

The procedure that we proposed to obtain the optimal parameters of NL-means is given as follows:

  1. 1.

    Evaluation and selection between the original weight function wORI in Eq. (2) and the improved weight function wIPOL in Eq. (3).

  2. 2.

    Evaluation and selection of the search window size.

  3. 3.

    Evaluation and selection of the patch size.

Figures 1 and 2 show the boxplot comparison for the windows sizes combinations and the weight functions in terms of the criteria: (1a) MAE, (1b) PSNR, (2a) SSIM, and (2b) processing time using the weight functions wORI (blue) and wIPOL (red) in the standard NL-means algorithm. From the plots (1a, 1b, and 2a), the original weight function wORI provides better metrics performance than the improved weight function wIPOL; moreover, the longest processing time values are obtained when the weight function wIPOL is used because of its optimal search window size of 35 × 35 pixels, and for larger sizes, the processing time increases considerably as it is shown in the plots of Fig. 2b. It must be highlighted that the whiskers and the outliers extent along a large metric interval since the several characteristics of the studied images. Nevertheless, this representation allows us to a better comparison for all the cases by means of the median and the interquartile range.

Fig. 1
figure 1

Boxplot performance comparison of a MAE and b PSNR criteria for standard NL-means algorithm for different windows sizes combinations and the two weight functions

Fig. 2
figure 2

Boxplot performance comparison of a SSIM criterion and b processing time for standard NL-means algorithm for different windows sizes combinations and the two weight functions

For the quality metrics, we obtain the minimum median value on the search windows of 13 × 13 and 17 × 17 pixels; regarding to the patch size, the analysis reveals that the optimal is the smallest size evaluated in all the cases. As it can be seen, the MAE and PSNR quality metrics values for the two weight functions get closer increasing windows sizes. In the case of SSIM criterion, some combinations like 29 × 11, 29 × 13, 35 × 11, 35 × 13, 39 × 11, and 39 × 13, the wIPOL function improves the original weight function, but the processing time is bigger than the obtained from smaller windows where the SSIM value is better.

The Fig. 3 depicts the graphic representation of the wORI and wIPOL functions for some distances and for patch sizes of f = {1, 2, 3, 4, 5, 6}. Here, it is observed that the original weight function wORI is a complete Gaussian function (see Fig. 3a), which gives a weight for each pixel within the patch window in a greater or lesser extent, and the Gaussian function opening is affected directly by the patch size. On the other hand, the improved weight function wIPOL is set to average similar patches up to noise (see Fig. 3b), namely, patches with square distances smaller than 2σ are set to 1, while larger distances decrease rapidly accordingly to the exponential kernel. So, this creates a strong dependence on the noise estimation to give the highest weight value leaving out some pixels. Thereupon, from this research, the original weight function wORI is chosen as an optimal parameter and is used in the next experiments.

Fig. 3
figure 3

Graphic representation of the a original weight function and b modified weight function

Figure 4 depicts the visual results obtained during the evaluation and selection of the patch size for the Barbara image. Figure 4a, b shows the close-ups of the original and noisy images, respectively. Figure 4cg presents the filtering results for distinct size patches of 3 × 3, 5 × 5, 7 × 7, 9 × 9, 11 × 11, and 13 × 13 pixels, respectively.

Fig. 4
figure 4

The visual results obtained during the evaluation and selection of the patch size, a original Barbara image close-up, b image corrupted with Gaussian noise of σ = 10, filtered images with different patch size of c 3 × 3, d 5 × 5, e 7 × 7, f 9 × 9, g 11 × 11, and h 13 × 13

The best metrics results were obtained using a patch size of 9 × 9 pixels providing better noise suppression and detail preservation in comparison with other patch sizes (as seen in Fig. 2), although the differences in the performance criteria for the patches evaluated are almost visually indistinguishable between the images of Fig. 4. The maximum difference between the best and the worst results in Fig. 4 in terms of the PSNR, MAE, and SSIM criteria are 0.4639 dB, 0.2948, and 0.0122, respectively. It is important to notize that when the patch size increases (i.e., 13 × 13), the smoothing begins to appear in many areas; this can be appreciated on the shadows of floor area in Fig. 4h.

From these experiments is clearly perceived the influence of these parameters, so that the noise is decreased considerably applying a search window size of 17 × 17 pixels and the patch size of 9 × 9 pixels.

To complement the research, it was developed the evaluation on small search windows and patches using t = {3,  4,  5,  6} and f = {1,  2,  3,  4,  5}. Figure 5 presents the statistical boxplots evaluation of small search windows and patches combinations. As it can be seen, the median values of the quality metrics are closer among them; the maximum differences are of 0.148, 0.671 dB, and 0.0082 for the MAE, the PSNR, and the SSIM criteria respectively. For the processing time, it is obtained a difference of 1.035 min measured between the smallest and the biggest window. From the plots, the best metrics values are given for the window size combination of 11 × 5 (MAE) and 13 × 3 (PSNR and SSIM). However, the time is about three or four times more than the search window size of 7 × 7 pixels.

Fig. 5
figure 5

Boxplot performance comparison of a MAE, b PSNR, c SSIM, and d processing time for standard NL-means algorithm for small windows sizes combinations

Considering the window sizes analysis achieved, it can emphasize the importance of the correct selection of the search window and patch size; and the meaningful difference when an optimal value of them is established.

According to the results presented in this section, the best parameters obtained for σ = 10 of Gaussian noise in grayscale images are the original weight function wORI, the search window sizes 11 × 11 or 13 × 13 pixels, and the patch size which can be chosen according to the visual results or the processing time. The results reveal that for large search or patch windows sizes, the processing time is longer; this is clear from the algorithm. Nevertheless, one of the objectives in this paper is to reduce the processing time by balancing the tradeoff between noise suppression, fine detail preservation, and processing time. For this reason, it is proposed a search window size of 7 × 7 pixels and a patch size of 5 × 5 pixels. Figure 5 presents the quantitative differences between the median value of 7 × 5 combination and the best values found: 0.0359, 0.177 dB, and 0.0031 for the MAE, the PSNR, and the SSIM criteria respectively; the processing time decreases in 1.0309 min in comparison with the 13 × 13 windows combination.

It was mentioned that the noise σ and filtering level h have a strong correlationship, so Buades [20] provides a table to solve this problem. However, the experimental results obtained in this section demonstrate better results achieved with a direct correlationship agreed to Tristán-Vega et al. [2]. Several experiments were also developed related on the variation of h in the tested images according to [24], and we found that the best metrics for the noise level σ = 10 were obtained using a filtering level of h = 12 in most cases.

The filtering parameter h is more sensitive in comparison with other parameters of the NL-means filtering. This is, if h is too small, little noise can be removed in the image, while if h is set too high (h >> σ), the image can be blurred [25]. There are several papers that show the optimal value of h based on σ. For instance, Manjon et al. [24] suggested a value of h = 1.2 × σ using the search window of 11 × 11 pixels and the similarity window of 5 × 5 pixels; Coupe et al. [26] proposed \( h=\sqrt{2\beta}\times \widehat{\sigma} \), where β = 1 and \( \widehat{\sigma} \) is the standard deviation estimation of the noise by 11 × 11 search window and 3 × 3 similarity window sizes; Bhushan et al. [27] presented a value of h = 0.72 for a 11 × 11 search window size; and Li et al. [25] provided a value of h = 0.45 for the search window size of 11 × 11 pixels. Moreover, the optimal value of h is not only a function of σ, the window sizes should be considered (i.e., the block size over which filtering is performed) [25]. For example, the computational cost of the filter is increased drastically as a function of the search window size; a good commitment between accuracy and computational load can be found with small values, since a further increase of this value does not produce a noticeable improvement but increases notably the filter computational cost [24]. These references reveal different values for the parameter h and close to 11 × 11 pixels for the search window size. Experimental results obtained indicate two variants for the proposed value of h = 1.0 × σ (h = 10 for σ = 10): (a) for the search window sizes of 11 × 11 or 13 × 13 pixels and the patch size is chosen according to the visual results; and (b) to reduce the processing time, the search window size of 7 × 7 pixels and the patch size of 5 × 5 pixels are proposed. It is noticed that the best metrics for the noise level σ = 10 were obtained using filtering level h = 1.2 × σ. According to the optimal parameters obtained by other researchers, there is a concordance with the proposal of Manjon et al. [24] that suggests the values of h = 1.2 × σ, the search window of 11 × 11 pixels, and the similarity window of 5 × 5 pixels. To demonstrate the performance of the proposed parameters against other ones using standard NL-means, Table 1 shows the quality metrics for BSD284, Cameraman, and Brain (obtained from Brain Web) images; in most cases, the best results were obtained from the proposed parameters; the processing time could be reduced without a significant quality lost.

Table 1 Quality metrics for parameters evaluation on the standard NL-means state-of-the-art (σ = 10)

It must be noticed that we only present the specific case of σ = 10; to find the optimal parameters for another σ value, it could be followed the complete proposed procedure or taking the search window and patch size previously found according to their needs (visual results or processing time) and then varying the h values looking for the best metric values.

2.3 The proposed IPNLM filter

The second goal of this paper is the proposal of an improved preclassification NLM (IPNLM) filter; hence, in this section, we introduce a modification in the filtering scheme of the standard NL-means algorithm employing an evaluation of descriptors for each search window in the noisy image to apply neighborhood preclassification to be able to distinguish if the current noisy pixel is located in a homogeneous region or in an object edge region. The proposal was taken from the idea that the noise is inherent in the images, so to solve this problem, several authors analyze the characteristics of the homogeneous regions and the edges of the objects in a noisy image and use the local region properties of the image pixels to discriminate between them [28, 29]. We made use of the parameters obtained in Section 2.2 for noise level σ  =10: search window size of 7 × 7 pixels, patch size of 5 × 5 pixels, and filtering level h = 12.

It was proposed to describe a texture region, the statistical method [30], where in the homogeneous areas the second central moment is low and when sudden changes happen, as edges, the second central moment is high.

The proposed algorithm takes advantage of the horizontal sweep used in standard NL-means determining homogeneous areas by computing the standard deviation of the current search window. The proposed criterion is based upon the comparison of the standard deviation of the neighborhood of the current search window with a threshold to make the filtering decision.

The standard deviation of the neighborhood σ SWi of the current search window intensities SWi centered at pixel i of {2t + 1| t} radius size is given as,

$$ {\sigma}_{S{W}_i}=\sqrt{\sum \limits_{k=i-t}^{i+t}{\left(u(k)-{\mu}_{S{W}_i}\right)}^2/{\left(2t+1\right)}^2,} $$
(4)

where \( {\mu}_{SW_i} \)is the mean of the search window intensities centered at pixel i.

Consequently, for each pixel in the image, it is estimated the standard deviation of its associated search window. So, we have n standard deviation values, where n is the total number of pixels in the whole image.

Then, we compare the standard deviation of the current search window \( {\sigma}_{SW_i} \) with a threshold to distinguish between homogeneous regions and object edge pixels. If the value of \( {\sigma}_{SW_i} \) is greater than a threshold value, the search window is considered to have object edge pixels, and it is performed the NL-means with the parameters previously established; otherwise, the search window has homogeneous regions and it is applied the mean filter since in this window there are no fine details or textures. The proposed filtering condition to the current noisy pixel is given as follows:

$$ IPNLM\left(v(i)\right)\kern0.5em =\kern0.5em \left\{\begin{array}{l}{\sigma}_{N_{SW}}(i)>{\mathrm{Threshold}}_x,\\ {}\mathrm{otherwise},\end{array}\kern1em \frac{NL\left(u(i)\right)}{N_{SW}(i)},\right. $$
(5)

where IPNLM(v(i)) is the filtering output of the proposed IPNLM, NL(u(i)) is the NL-means filtering using the parameters previously established, \( \overline{N_{SW}(i)} \) is the 3 × 3 mean filtering, and Thresholdx is the threshold based on the standard deviation of the search windows in the noisy image.

Two thresholds based on the R-estimators are proposed to carry out the filtering. The R-estimators form a class of nonparametric robust estimators based on rank calculations [31, 32]. In the case of absence of any a priori information about a probability distribution and data moments, the most powerful rank test is the median. The R-estimators are well-known robust estimators of location and they have already been used in image processing applications resulting in the so-called R-filters [31, 32]. For instance, the median estimator and the corresponding median filter are preferred when the observation data have long-tailed distributions. The median filter is very suitable for the removal of impulsive noise, so the median proposal consist of a window size of N = 2v + 1, which can reject up to v impulses proving good denoising capabilities. The median filter has good edge preservation properties, in such a way that, if the filter window is symmetric about the origin and includes the origin, the corresponding median filter preserves any step edge [31]. According to the properties described above, the R- (median) estimator can be used as noise detector to identify between a noisy pixel or an object edge pixel and a pixel related to a homogeneous region [33]. For these reasons, it is proposed to use the median estimator to compute the thresholds to perform a filtering level in a hard or soft way. One threshold is proposed as the median of the standard deviations of all the search windows in the whole image; this is to achieve a hard filtering condition; and the other one is established as the half of the first threshold, so it is considered a soft filtering condition. Both filtering conditions are modeled as in the following equation:

$$ {\displaystyle \begin{array}{c}{\mathrm{Threshold}}_1\kern0.5em =\kern0.5em \frac{\mathrm{median}\left[{\sigma}_{SW}(1),{\sigma}_{SW}(2),\dots, {\sigma}_{SW}(n)\right]}{2},\\ {}{\mathrm{Threshold}}_2\kern0.5em =\kern0.5em \frac{\mathrm{median}\left[{\sigma}_{SW}(1),{\sigma}_{SW}(2),\dots, {\sigma}_{SW}(n)\right]}{}\end{array}} $$
(6)

where Threshold1 or Threshold2 can be used in the variable Thresholdxin Eq. (5).

Using the exposed conditions, the proposed IPNLM algorithm can evaluate the homogeneity of the current search window and is possible to decide if the current pixel is filtered with NL-means or the mean algorithm. In this way, the pixels are classified using the thresholds based on the standard deviation of the local region properties in the noisy image to provide a commitment between the image denoising and the processing time. If the proposed IPNLM algorithm applies the Threshold2, more pixels could be filtered using the mean filter, implying less computational processing time than the Threshold1, which only takes the half of the value of Threshold2, and the rest of the pixels could be filtered using NL-means with optimal parameters, increasing the processing time.

The runtime analysis of the IPNLM filter with the proposed thresholds (Threshold1 and Threshold2) and the standard NL-means filter were conducted for different images and frames of the video sequences using Matlab 2011 in a PC with Intel Core i7 CPU, 4 GB RAM, and Windows 7 Ultimate.

The complexity of the standard NL-means algorithm is given as,

$$ search\ window\times similarity\ square\ neighborhood\times N\times M, $$
(7)

where N × M is the image size (i.e., number of pixels of the image) [1].

According to the suggested parameters of Table 1 provided in [20], a search window of 21 × 21 pixels and a similarity square neighborhood of 3 × 3 pixels are needed for the condition σ = 10; so, the final complexity of the standard NL-means is about 441 × 9 × N × M [1]. For the proposal IPNLM, the minimum complexity is ((n1 × m1 − 1) × N × M) times the addition [34], where n1 × m1 is the filtering window size; this is determined when the threshold is greater than the standard deviation of the neighborhood of the search window, to wit, the IPNLM is changed by the mean filter; and the maximum is given by 49 × 25 × N × M considering the optimal values found in Section 2.2; to wit, when the filtered process is performed only with the NL-means algorithm. Additionally, since to obtain the median of a window of N × M values of the standard deviations, the average number of comparisons is typically proportional to N × M; assuming the original random ordering procedure [35], the complexity of the proposed Threshold1 is N × M comparisons plus one division and for Threshold2 is N × M comparisons. Finally, the complexity of proposed IPNLM method depends on the size of the input image and the image scene content, where the thresholds control the number of pixels to be filtered with the mean or the NL-means algorithm with the parameters previously established.

3 Results and discussion

We developed the evaluations in 150 images to obtain the performance of the standard NL-means and the proposed IPNLM with the two thresholds in the case of the use of the optimal values proposed and the values provided by Buades [20]. Figure 6 shows the boxplots for the (a) MAE, (b) PSNR, (c) SSIM, and the (d) processing time criteria.

Fig. 6
figure 6

Boxplot comparison of a MAE, b PSNR, c SSIM criteria, and d processing time between standard NL-means algorithm and IPNLM proposal, using (1) optimal parameters and (2) Buades parameters

In general, analyzing the three algorithms, when the proposed IPNLM uses the parameters provided by Buades [20] (IPNLMT1(2) and IPNLMT2(2)), the statistic of the metric results are better than the standard NL-means (NLM), but they are worse than the IPNLM using our optimal parameters (IPNLMT1(1) and IPNLMT2(1)). The processing time, in the last one, decreases considerably because of the small window sizes.

In the specific case of the thresholds, it is important to notice that the IPNLM Threshold1 provides better results than the IPNLM Threshold2, but the processing time among them is reduced in almost an a half in benefit of the IPNLM Threshold2; so, considering the last one, it could work for cases when the time is an important variable.

In Fig. 7, some visual results in some images are provided by using the standard NL-means and the proposed IPNLM. From this figure, one can see that the filtering results obtained with the proposed IPNLM Threshold1 and IPNLM Threshold2 produce better metrics and visual image denoising in comparison with the standard NL-means.

Fig. 7
figure 7

The visual results of some images by using the standard NL-means and the proposed IPNLM methods: column (a) original images; column (b) noisy images; column (c) denoised images by standard NL-means; column (d) denoised images by IPNLM Threshold1 with optimal paramaters; and column (e) denoised images by IPNLM Threshold2 with optimal parameters

The proposed IPNLM Threshold1,2 (1) algorithms have been evaluated in the case of degraded images with σ = {10, 20, 30, 40} of AWGN and compared with some state-of-the-art algorithms. Figure 6 shows the boxplots of the denoising results using the proposed IPNLM Threshold1,2, standard NL-means and some NL-means-based filters, such as the non-local means based on edge detection (NLM-ED) [14], the generalized non-local means (GNL-means) [11], the non-local fuzzy means (NLFM) [16], and adaptive isotropic non-local means (ANLM) [17] filters. The chosen filters, as comparative, show advantages against other state-of-the-art filters found in scientific literature.

One advantage of the proposed IPNLM filter is the fixed value of the parameters found after an extensive research for the noise level σ = 10 (those are, 7 × 7 pixels window size, patch size of 5 × 5 pixels, and filtering level h = 12). These parameters provide better results in most cases in comparison with other filters. For the cases where the noise level is different of 10, it was established the value of h = σ to evaluate all the images.

From Fig. 8, the median values for σ = 10 demonstrate that the proposed IPNLM Threshold1 and Threshold2 produce better quality metrics values and the lesser processing time. The high value outliers for the MAE and the low value outliers for the PSNR and SSIM criteria were less and better in most cases than other filters, a more desirable result. Nevertheless, we have to emphasize that the sample chosen include different texture, content, sizes in the images, which produce larger whiskers along the metric values.

Fig. 8
figure 8

Boxplot performance comparison of a MAE, b PSNR, c SSIM, and d processing time for the performance between the IPNLM Threshold1,2 algorithm and NL-means-based filters algorithms in the case of degraded images with different noise levels AWGN

In the case of σ = 20, 30, 40, the algorithm provides competitive performance in comparison with some NL-means-based methods [11, 14, 16, 17]. It could be noticed that some median values from other filters get closer or better than the proposal; however, in this case, we are not looking for an optimal h value or window sizes, which could improve the results.

In general, analyzing the processing time, the proposed IPNLM is faster than other filters for the samples evaluated and the whiskers are very close from the interquartile range. We noticed that the GNL-means and NLM-ED algorithms execute NL-means and other stages to refine the denoising results, which increases computational processing time.

4 Conclusions

The standard NL-means was implemented and evaluated for σ = 10 of Gaussian noise and it was found that the best results in the PSNR, MAE, and SSIM criteria are for the 11 × 11 and 13 × 13 search window sizes; nevertheless, the lowest processing time is achieved for the 7 × 7 search window size. The highlight is that the present research work allows a first optimization in the standard NL-means algorithm by means of the use of optimal parameters for the search window and patch sizes of the standard NL-means; using the parameters of 7 × 7 search window size and 5 × 5 patch window size, the filter is faster than using the parameters established by Buades [20], and moreover, the quality metric values are improved. Performance results indicate that the proposed parameters provide better results in comparison with other parameters optimization found in the novel scientific literature applied on the standard NL-means in terms of quality metrics and processing time.

After that, a second optimization using neighborhood preclassification to evaluate the homogeneity in the noisy image improves the performance results in terms of the MSE, PSNR, and SSIM criteria in comparison with the standard NL-means and other state-of-the-art filters in most cases when the noise level is σ = 10. Performance boxplot results in images degraded with different noise levels using the proposed parameters and the parameters provided by Buades [20] applied on the proposed IPNLM reveals that the IPNLM produce better results in the metrics using both parameters in comparison with the standard NL-means. Moreover, the outcomes of IPNLM are better than NL-means-based filters in most cases.

The processing time can be reduced by almost 8 times using IPNLM Threshold1 and about 15 times with IPNLM Threshold2 in comparison with the standard NL-means, so the proposed method potentially could provide a real-time solution of denoising schemes implemented in some specific purpose devices. Finally, extensive simulation results with different images have demonstrated that the proposed filter consistently outperforms other filters by balancing the tradeoff between the noise suppression, the fine details and edges preservation, besides in optimizing and saving computational charge resources.

Abbreviations

ANLM:

Adaptive isotropic non local-means

AWGN:

Additive white Gaussian noise

FFT:

Fast Fourier transform

GNL:

Generalized non local

HVS:

Human visual system

IPNLM:

Improved preclassification non local-means

IPNLM-T1:

Improved preclassification non local-means using threshold1

IPNLM-T2:

Improved preclassification non local-means using threshold2

MAE:

Mean absolute error

MSE:

Mean square error

NL:

Non local

NLFM:

Non local fuzzy means

NLM:

Non local means

NLM-ED:

Non local means based on edge detection

PSNR:

Peak signal-to-noise ratio

SSIM:

Structural similarity index

References

  1. A. Buades, B. Coll, J. Morel, A review of image denoising algorithms, with a new one. SIAM Interdisc. J. Multiscale Modeling Simul. 4(2), 290–530 (2005)

    MathSciNet  MATH  Google Scholar 

  2. A. Tristán-Vega, V. García Pérez, S. Aja-Fernández, C.F. Westin, Efficient and robust nonlocal means denoising of MR data based on salient featuresmatching. Comput. Methods Prog. Biomed. 105(2), 131–144 (2012)

    Article  Google Scholar 

  3. G. Chen, P. Zhang, Y. Wu, D. Shen, P.T. Yap, Denoising magnetic resonance images using collaborative non-local means. Neurocomputing 177, 215–227 (2016)

    Article  Google Scholar 

  4. B. Liu, X. Sang, S. Xing, B. Wang, Noise suppresion in brain magnetic resonance imaging based on non-local means filter and fuzzy cluster. Optik-Int. J. Light Elect. Optics 126(21), 2955–2959 (2015)

    Article  Google Scholar 

  5. H. Liu, C. Yang, N. Pan, E. Song, R. Green, Denosing 3D MR images by the enhanced non-local means filter for Rician noise. Magn. Reson. Imaging 28(10), 1485–1496 (2010)

    Article  Google Scholar 

  6. R. Kumar, M. Rattan, Analysis of various quality metrics for medical image processing. Int. J. Adv. Res. Comp. Sci. Soft Eng 2(11), 137–144 (2012)

  7. A. Dauwe, B. Goossens, H. Luong, W. Phillips, A fast non-local image denoising algorithm. Proc. SPIE Electronic Imaging 6812, 1–8 (2008)

  8. C. Kervrann, J. Boulanger, Optimal spatial adaptation for patch-based image denoising. IEEE Trans. Image Processing 15(10), 2866–2878 (2006)

    Article  Google Scholar 

  9. J. Wang, Y. Guo, Y. Ying, Y. Liu, Q. Peng, Fast non-local algorithm for image denoising. Proc. IEEE Int. Conf. Image Processing (ICIP), 1429–1432 (2006)

  10. J.R. Isidoro, P. Milanfar, A pull-push method for fast non-local means filtering. 2016. IEEE Int. Conf. Image Processing (ICIP), 1968–1972 (2016)

  11. E. Luo, S. Pan, T. Nguyen, Generalized non-local means for iterative denoising. 20th European Signal Processing Conference (EUSIPCO), 260–264 (2012)

  12. A.A. Dixit, A.C. Phadke, Image de-noising by non-local means algorithm. 2013 Int. Conf. On signal processing. Image Processing Pattern Recognition (ICSIPR), 1–3 (2013)

  13. A.A. Dixit, A.C. Phadke, De-noising of Gaussian noise affected images by non-local means algorithm. 2013 Int. Conf. On circuits. Power Computing Technologies (ICCPCT), 1215–1218 (2013)

  14. K. Gan,  J. Tan, L. He, Non-local means image denoising algorithm based on edge detection. 2014. Int. Conf. Digital Home, 117–121 (2014)

  15. V. Bruni, D. Panella, D. Vitulano, Non local means image denoising using noise-adaptive SSIM. 23RD European Signal Processing Conference (EUSIPCO), 2326–2330 (2015)

  16. R. Lan, Y. Yan Tang, C.L. Philip Chen, Image denoising using non-local fuzzy means. 2015. IEEE China Summit Int. Conf. Signal Information Processing (China SIP), 196–200 (2015)

  17. R. Verma, R. Pandey, Non local means algorithm with adaptive isotropic search window size for image denoising. Anual IEEE India Conference (INDICON), 1–5 (2015)

  18. J. Wang, J. Su, Y. Hou, W. Hou, Adaptive image denoising method based on non-local means filtering. 7th Int. Conf. Modelling, Identification Control (ICMIC), 1–4 (2015)

  19. I.V. Hernandez-Gutierrez, F. Gallegos-Funes, A. Rosales-Silva, V. Ponomaryov, V. Kravchenko, Improved nonlocal means using preclassificated windows. 2016 9th Int. Kharkiv symposium on physics and engineering of microwaves. Millimeter Submillimeter Waves (MSMW), 1–4 (2016)

  20. A. Buades, B. Col, J.M. Morel, Non-local means denoising. Image Processing Line 1, 208–212 (2011) https://doi.org/10.5201/ipol.2011.bcm_nlm. Accessed 15 January 2017

    Google Scholar 

  21. The Berkeley Segmentation Dataset and Benchmark. https://www2.eecs.berkeley.edu/Research/Projects/CS/vision/bsds/. Accessed 15 January 2017

  22. P. Kaur, J. Singh, A study on the effect of gaussian noise in PSNR value for digital images. Int. J. Computer Electrical Engineering 3(2), 319–321 (2011)

    Article  Google Scholar 

  23. Z. Wang, A.C. Bovik, H. Sheikh, E. Simoncelli, Image quality assessment: from error visibility to structural similarity. IEEE Trans. Image Process. 13(4), 600–612 (2004)

    Article  Google Scholar 

  24. J.V. Manjon, J. Carbonell-Caballero, J.J. Lull, G. Garcıa-Martı, L. Martı-Bonmatı, M. Robles, MRI denoising using non-local means. Med. Image Anal. 12, 514–523 (2008)

  25. J. Li, R.M. Leahy, Parameter selection for optimized non-local means filtering of task fMRI. IEEE 14th Int. Symposium Biomedical Imaging, 476–480 (2017)

  26. P. Coupe, P. Yger, S. Prima, P. Hellier, C. Kervrann, C. Barillot, An optimized blockwise nonlocal means denoising filter for 3-d magnetic resonance images. IEEE Trans. Medical Imaging 27(4), 425–441 (2008)

    Article  Google Scholar 

  27. C. Bhushan, M. Chong, S. Choi, A.A. Joshi, J.P. Haldar, H. Damasio, R.M. Leahy, Temporal non-local means filtering reveals real-time whole-brain cortical interactions in resting fmri. PLoS One 11(7) (2016). https://doi.org/10.1371/journal.pone.0158504

    Article  Google Scholar 

  28. C. Liu, W. Liu, W. Xing, An improved edge-based level set method combining local regional fitting information for noisy image segmentation. Signal Process. 130, 12–21 (2017)

    Article  Google Scholar 

  29. S. Pyatykh, J. Hesser, L. Zheng, Image noise level estimation by principal component analysis. IEEE Trans. Image Processing 22(2), 687–699 (2013)

    Article  MathSciNet  Google Scholar 

  30. R.C. Gonzalez, R.E. Woods, Digital image processing, 3rd edn. (Prentice Hall, NJ, 2006)

    Google Scholar 

  31. F.J. Gallegos-Funes, A.J. Rosales-Silva, A. Toledo-Lopez, Multichannel image processing by using the rank M-type L-filter. J. Visual Communication Image Representation 23(2), 323–330 (2012)

    Article  Google Scholar 

  32. D. Mújica-Vargas, F.J. Gallegos-Funes, A.J. Rosales-Silva, A fuzzy clustering algorithm with spatial robust estimation constraint for noisy color image segmentation. Pattern Recogn. Lett. 34(4), 400–413 (2013)

    Article  Google Scholar 

  33. B.E. Carvajal-Gamez, F.J. Gallegos-Funes, A.J. Rosales-Silva, Color local complexity estimation based steganographic (CLCES) method. Expert Syst. Appl. 40(3), 1132–1142 (2013)

    Article  Google Scholar 

  34. P. Jian-Jia, T. Yuan-Yan, P. Bao-Chang, The algorithm of fast mean filtering. Proc. 2007 Int. Conf. Wavelet Analysis Pattern Recognition, 244–248 (2007)

  35. T.S. Huang, G.J. Yang, G.Y. Tang, A fast two-dimensional median filtering algorithm. IEEE Trans. Acoustics, Speech, Signal Processing ASP 27(1), 13–18 (1979)

    Article  Google Scholar 

Download references

Acknowledgments

This work is supported by Instituto Politécnico Nacional de México (IPN) and Consejo Nacional de Ciencia y Tecnología (Conacyt), project 240820.

Author information

Authors and Affiliations

Authors

Contributions

FG suggested the idea, IH contributed with the implementation, the experimentation, the final proposal, and paper writing. AR and FG supervised the experiments and suggested modifications. All authors read and approved the final manuscript.

Corresponding author

Correspondence to Isabel V Hernández-Gutiérrez.

Ethics declarations

Authors’ information

Isabel Hernandez received Mechatronics Engineering degree in 2009 and M.Sc. in Mechanics degree in 2013 by Instituto Politecnico Nacional, Mexico. Currently, she is a PhD student of Instituto Politecnico Nacional, Mexico. Alberto Rosales PhD in Communications and Electronics (2008), Master of Science in Telecommunications Engineering (2004) and Engineer Communications and Electronics (1999) by ESIME-Instituto Politécnico Nacional de México. Topics currently being developed are image processing, multispectral and multichannel video in real time, visual computing, as well as medical image processing.

Ethics approval and consent to participate

Not applicable.

Consent for publication

Not applicable.

Competing interests

The authors declare that they have no competing interests.

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Hernández-Gutiérrez, I.V., Gallegos-Funes, F.J. & Rosales-Silva, A.J. Improved preclassification non local-means (IPNLM) for filtering of grayscale images degraded with additive white Gaussian noise. J Image Video Proc. 2018, 104 (2018). https://doi.org/10.1186/s13640-018-0346-y

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/s13640-018-0346-y

Keywords