# Impulsive Noise Removal with an Adaptive Weighted Arithmetic Mean Operator for Any Noise Density
## 3 Weighted Arithmetic Mean Based Fuzzy Filter Algorithm
### Noise Detection Phase Based on Fuzzy Open-Close Operators
This image database is publicly available at [[http://sipi.usc.edu/database/misc.tar.gz](http://sipi.usc.edu/database/misc.tar.gz)]([http://sipi.usc.edu/database/misc.tar.gz](http://sipi.usc.edu/database/misc.tar.gz)). Moreover, some well-known images that are usually used in noise removal: _barbara_, _cameraman_, _claine_, _goldhill_, _lenna_, _tifany_ and two test images _lenna with gray rectangles_ and _bycicle test_ have also been included into the database. Applying salt-and-pepper noise (where 255 means salt and 0 means pepper) with the same probability leads to the generation of the database for the comparison experiments. Specifically, densities from 5% to 95% with a step of 5% were considered as well as a final 98% density and applied to each of the images of the database. Given that the proposed filter depends on the parameters \(n\), \(\beta\) and \(d\), we need to divide the set of 44 images into two subsets: the training set and the test image set. With the training set, as we will explain in Section 4.3, we will find the best parameter configuration for our filter. Then, the test set will be used to compare the performance of the AWAM filter setting the optimal configuration, found with the training set, with respect to several filters that will be presented in Section 4.4. With this procedure, a fair comparison is achieved. More specifically, 26 of the 44 images (\(\approx\)60%) are chosen as the training set and the remaining 18 (\(\approx\)40%) as the test set. The choice of all these images has been made randomly by setting a randomization seed. ### Performance Measures

In addition to the visual comparison of the results obtained by the filters, the restoration performance should be measured using several quantitative performance measures. The objective evaluation of the quality of the results is of great importance when an image must be restored or its noise reduced. For this reason, a set of measures which are representative of the state of the art were used. We selected and used four measures, Mean-Squared Error (MSE), Mean Structural Similarity Index Measure (M-SSIM), Peak Signal-to-Noise Ratio - Human Visual System (PSNRHVS ), and Visual Information Fidelity (VIF). The first two measures are widely used, and PSNRHVS and VIF were introduced more recently with the aim to incorporate the human visual system (HSV) in the metric. The code for these metrics are freely accessible and can be used by any researcher. The M-SSIM code can be found in [[http://live.ece.utexas.edu/research/quality/ssim/](http://live.ece.utexas.edu/research/quality/ssim/)]([http://live.ece.utexas.edu/research/quality/ssim/](http://live.ece.utexas.edu/research/quality/ssim/)) or in [[https://ece.uwaterloo.ca/~z70](https://ece.uwaterloo.ca/~z70) wang/research/ssim/]([https://ece.uwaterloo.ca/~z70](https://ece.uwaterloo.ca/~z70) wang/research/ssim/). The code for PSNRHVS is accessible in [[http://ponomarenko.info/psnrhvsm.htm](http://ponomarenko.info/psnrhvsm.htm)]([http://ponomarenko.info/psnrhvsm.htm](http://ponomarenko.info/psnrhvsm.htm)). The code for VIF can be found in [[http://live.ece.utexas.edu/research/quality/index.htm](http://live.ece.utexas.edu/research/quality/index.htm)]([http://live.ece.utexas.edu/research/quality/index.htm](http://live.ece.utexas.edu/research/quality/index.htm)). A brief overview of each selected metric is presented below. Hereinafter, we will denote by \(I_{1}\) the noise-free original image, on which some restoration filter has been used. Let \(I_{2}\) be the output of the restoration filter. MSE is computed using the following equation:

\[\text{MSE}(I_{1},I_{2})=\frac{\sum\limits_{m,n}\left(I_{1}(m,n)-I_{2}(m,n) \right)^{2}}{M\times N}.\]

This metric is computed solely on differences among pixels and sometimes its results are very far from those perceived by the HSV. Lower MSE values are an indication of better capabilities of the considered filter.