 Research
 Open
 Published:
Improved preclassification non localmeans (IPNLM) for filtering of grayscale images degraded with additive white Gaussian noise
EURASIP Journal on Image and Video Processingvolume 2018, Article number: 104 (2018)
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 signaltonoise 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 NLmeans, we propose the improved preclassification non localmeans (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 NLmeans 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 NLmeans and other analyzed filters.
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 NLmeans 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 FFTbased computation of the neighborhood similarities [9], and the multiscale methodology of the pullpush scattered data interpolation method [10] to improve the NLmeans. Enming Luo et al. [11] incorporated noise dependence into the weight function of NLmeans 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 NLmeans 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 NLmeans 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 NLmeans, V. Bruni et al. [15] embedded the structural similarity index (SSIM) criterion in place of the L_{2} 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 NLmeans algorithm behavior on different search and patch windows sizes to obtain the optimum parameters where the values of the peak signaltonoise 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 NLmeans, we propose the improved preclassification non localmeans 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 NLmeans and other filters based on NLmeans 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 NLmeans.
The paper structure is organized as follows: in Section 2.1 is explained the standard NLmeans algorithm. In Section 2.2 is shown the simulation experiments to find optimal parameters for the standard NLmeans. In Section 2.3 is presented the proposed IPNLM algorithm and its filtering performance in comparison with different NLmeans based filters. In Section 3 are set out the results and its discussion. Finally, the conclusions are given in Section 4.
Methods/experimental
Standard NLmeans algorithm
The NLmeans 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)i ∈ I}. Then, the estimated NLmeans value NL(u(i)) for a pixel i is computed as a weighted average of all the pixels in the image,
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 ∑_{j}w(i, j) = 1. This similarity is based on the magnitude correspondence of the gray levels neighborhoods u(N_{i}) and u(N_{j}), where N_{k} 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 N_{i} have larger weights in the average weights. These weights are defined as,
where w_{ORI} 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 NLmeans, 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 w_{IPOL} is given as follows [20],
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].
Optimal parameter values for the NLmeans
There are initial parameters that must be established in the NLmeans 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 NLmeans 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 NLmeans 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 = {w_{ORI}, w_{IPOL}}, 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 NLmeans is given as follows:

1.
Evaluation and selection between the original weight function w_{ORI} in Eq. (2) and the improved weight function w_{IPOL} in Eq. (3).

2.
Evaluation and selection of the search window size.

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 w_{ORI} (blue) and w_{IPOL} (red) in the standard NLmeans algorithm. From the plots (1a, 1b, and 2a), the original weight function w_{ORI} provides better metrics performance than the improved weight function w_{IPOL}; moreover, the longest processing time values are obtained when the weight function w_{IPOL} 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.
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 w_{IPOL} 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 w_{ORI} and w_{IPOL} 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 w_{ORI} 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 w_{IPOL} 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 w_{ORI} is chosen as an optimal parameter and is used in the next experiments.
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 closeups of the original and noisy images, respectively. Figure 4c–g presents the filtering results for distinct size patches of 3 × 3, 5 × 5, 7 × 7, 9 × 9, 11 × 11, and 13 × 13 pixels, respectively.
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.
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 w_{ORI}, 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ánVega 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 NLmeans 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 NLmeans, 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.
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.
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 NLmeans 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 NLmeans 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 σ SW_{i} of the current search window intensities SW_{i} centered at pixel i of {2t + 1 t ∈ ℕ} radius size is given as,
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 NLmeans 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:
where IPNLM(v(i)) is the filtering output of the proposed IPNLM, NL(u(i)) is the NLmeans filtering using the parameters previously established, \( \overline{N_{SW}(i)} \) is the 3 × 3 mean filtering, and Threshold_{x} is the threshold based on the standard deviation of the search windows in the noisy image.
Two thresholds based on the Restimators are proposed to carry out the filtering. The Restimators 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 Restimators are wellknown robust estimators of location and they have already been used in image processing applications resulting in the socalled Rfilters [31, 32]. For instance, the median estimator and the corresponding median filter are preferred when the observation data have longtailed 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:
where Threshold_{1} or Threshold_{2} can be used in the variable Threshold_{x}in 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 NLmeans 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 Threshold_{2}, more pixels could be filtered using the mean filter, implying less computational processing time than the Threshold_{1}, which only takes the half of the value of Threshold_{2}, and the rest of the pixels could be filtered using NLmeans with optimal parameters, increasing the processing time.
The runtime analysis of the IPNLM filter with the proposed thresholds (Threshold_{1} and Threshold_{2}) and the standard NLmeans 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 NLmeans algorithm is given as,
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 NLmeans is about 441 × 9 × N × M [1]. For the proposal IPNLM, the minimum complexity is ((n_{1} × m_{1} − 1) × N × M) times the addition [34], where n_{1} × m_{1} 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 NLmeans 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 Threshold_{1} is N × M comparisons plus one division and for Threshold_{2} 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 NLmeans algorithm with the parameters previously established.
Results and discussion
We developed the evaluations in 150 images to obtain the performance of the standard NLmeans 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.
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 NLmeans (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 Threshold_{1} provides better results than the IPNLM Threshold_{2}, but the processing time among them is reduced in almost an a half in benefit of the IPNLM Threshold_{2}; 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 NLmeans and the proposed IPNLM. From this figure, one can see that the filtering results obtained with the proposed IPNLM Threshold_{1} and IPNLM Threshold_{2} produce better metrics and visual image denoising in comparison with the standard NLmeans.
The proposed IPNLM Threshold_{1,2} (1) algorithms have been evaluated in the case of degraded images with σ = {10, 20, 30, 40} of AWGN and compared with some stateoftheart algorithms. Figure 6 shows the boxplots of the denoising results using the proposed IPNLM Threshold_{1,2}, standard NLmeans and some NLmeansbased filters, such as the nonlocal means based on edge detection (NLMED) [14], the generalized nonlocal means (GNLmeans) [11], the nonlocal fuzzy means (NLFM) [16], and adaptive isotropic nonlocal means (ANLM) [17] filters. The chosen filters, as comparative, show advantages against other stateoftheart 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 Threshold_{1} and Threshold_{2} 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.
In the case of σ = 20, 30, 40, the algorithm provides competitive performance in comparison with some NLmeansbased 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 GNLmeans and NLMED algorithms execute NLmeans and other stages to refine the denoising results, which increases computational processing time.
Conclusions
The standard NLmeans 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 NLmeans algorithm by means of the use of optimal parameters for the search window and patch sizes of the standard NLmeans; 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 NLmeans 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 NLmeans and other stateoftheart 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 NLmeans. Moreover, the outcomes of IPNLM are better than NLmeansbased filters in most cases.
The processing time can be reduced by almost 8 times using IPNLM Threshold_{1} and about 15 times with IPNLM Threshold_{2} in comparison with the standard NLmeans, so the proposed method potentially could provide a realtime 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 localmeans
 AWGN:

Additive white Gaussian noise
 FFT:

Fast Fourier transform
 GNL:

Generalized non local
 HVS:

Human visual system
 IPNLM:

Improved preclassification non localmeans
 IPNLMT1:

Improved preclassification non localmeans using threshold_{1}
 IPNLMT2:

Improved preclassification non localmeans using threshold_{2}
 MAE:

Mean absolute error
 MSE:

Mean square error
 NL:

Non local
 NLFM:

Non local fuzzy means
 NLM:

Non local means
 NLMED:

Non local means based on edge detection
 PSNR:

Peak signaltonoise 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)
 2.
A. TristánVega, V. García Pérez, S. AjaFerná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)
 3.
G. Chen, P. Zhang, Y. Wu, D. Shen, P.T. Yap, Denoising magnetic resonance images using collaborative nonlocal means. Neurocomputing 177, 215–227 (2016)
 4.
B. Liu, X. Sang, S. Xing, B. Wang, Noise suppresion in brain magnetic resonance imaging based on nonlocal means filter and fuzzy cluster. OptikInt. J. Light Elect. Optics 126(21), 2955–2959 (2015)
 5.
H. Liu, C. Yang, N. Pan, E. Song, R. Green, Denosing 3D MR images by the enhanced nonlocal means filter for Rician noise. Magn. Reson. Imaging 28(10), 1485–1496 (2010)
 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 nonlocal image denoising algorithm. Proc. SPIE Electronic Imaging 6812, 1–8 (2008)
 8.
C. Kervrann, J. Boulanger, Optimal spatial adaptation for patchbased image denoising. IEEE Trans. Image Processing 15(10), 2866–2878 (2006)
 9.
J. Wang, Y. Guo, Y. Ying, Y. Liu, Q. Peng, Fast nonlocal algorithm for image denoising. Proc. IEEE Int. Conf. Image Processing (ICIP), 1429–1432 (2006)
 10.
J.R. Isidoro, P. Milanfar, A pullpush method for fast nonlocal means filtering. 2016. IEEE Int. Conf. Image Processing (ICIP), 1968–1972 (2016)
 11.
E. Luo, S. Pan, T. Nguyen, Generalized nonlocal means for iterative denoising. 20th European Signal Processing Conference (EUSIPCO), 260–264 (2012)
 12.
A.A. Dixit, A.C. Phadke, Image denoising by nonlocal means algorithm. 2013 Int. Conf. On signal processing. Image Processing Pattern Recognition (ICSIPR), 1–3 (2013)
 13.
A.A. Dixit, A.C. Phadke, Denoising of Gaussian noise affected images by nonlocal means algorithm. 2013 Int. Conf. On circuits. Power Computing Technologies (ICCPCT), 1215–1218 (2013)
 14.
K. Gan, J. Tan, L. He, Nonlocal 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 noiseadaptive SSIM. 23^{RD} European Signal Processing Conference (EUSIPCO), 2326–2330 (2015)
 16.
R. Lan, Y. Yan Tang, C.L. Philip Chen, Image denoising using nonlocal 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 nonlocal means filtering. 7th Int. Conf. Modelling, Identification Control (ICMIC), 1–4 (2015)
 19.
I.V. HernandezGutierrez, F. GallegosFunes, A. RosalesSilva, 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, Nonlocal means denoising. Image Processing Line 1, 208–212 (2011) https://doi.org/10.5201/ipol.2011.bcm_nlm. Accessed 15 January 2017
 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)
 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)
 24.
J.V. Manjon, J. CarbonellCaballero, J.J. Lull, G. GarcıaMartı, L. MartıBonmatı, M. Robles, MRI denoising using nonlocal means. Med. Image Anal. 12, 514–523 (2008)
 25.
J. Li, R.M. Leahy, Parameter selection for optimized nonlocal 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 3d magnetic resonance images. IEEE Trans. Medical Imaging 27(4), 425–441 (2008)
 27.
C. Bhushan, M. Chong, S. Choi, A.A. Joshi, J.P. Haldar, H. Damasio, R.M. Leahy, Temporal nonlocal means filtering reveals realtime wholebrain cortical interactions in resting fmri. PLoS One 11(7) (2016). https://doi.org/10.1371/journal.pone.0158504
 28.
C. Liu, W. Liu, W. Xing, An improved edgebased level set method combining local regional fitting information for noisy image segmentation. Signal Process. 130, 12–21 (2017)
 29.
S. Pyatykh, J. Hesser, L. Zheng, Image noise level estimation by principal component analysis. IEEE Trans. Image Processing 22(2), 687–699 (2013)
 30.
R.C. Gonzalez, R.E. Woods, Digital image processing, 3rd edn. (Prentice Hall, NJ, 2006)
 31.
F.J. GallegosFunes, A.J. RosalesSilva, A. ToledoLopez, Multichannel image processing by using the rank Mtype Lfilter. J. Visual Communication Image Representation 23(2), 323–330 (2012)
 32.
D. MújicaVargas, F.J. GallegosFunes, A.J. RosalesSilva, A fuzzy clustering algorithm with spatial robust estimation constraint for noisy color image segmentation. Pattern Recogn. Lett. 34(4), 400–413 (2013)
 33.
B.E. CarvajalGamez, F.J. GallegosFunes, A.J. RosalesSilva, Color local complexity estimation based steganographic (CLCES) method. Expert Syst. Appl. 40(3), 1132–1142 (2013)
 34.
P. JianJia, T. YuanYan, P. BaoChang, 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 twodimensional median filtering algorithm. IEEE Trans. Acoustics, Speech, Signal Processing ASP 27(1), 13–18 (1979)
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
Affiliations
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ándezGutié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 ESIMEInstituto 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.
About this article
Received
Accepted
Published
DOI
Keywords
 Non localmeans
 Additive white Gaussian noise
 Neighborhood preclassification
 Search windows
 Patch size
 Grayscale image denoising