Iterative Removing Salt and Pepper Noise based on Neighbourhood Information

Denoising images is a classical problem in low-level computer vision. In this paper, we propose an algorithm which can remove iteratively salt and pepper noise based on neighbourhood while preserving details. First, we compute the probability of different window without free noise pixel by noise ratio, and then determine the size of window. After that the corrupted pixel is replaced by the weighted eight neighbourhood pixels. If the neighbourhood information does not satisfy the denoising condition, the corrupted pixels will recover in the subsequent iterations. Keywords—Salt and pepper noise; noise detection; neighbourhood similarity; detail preserving denoising


I. INTRODUCTION
Salt and pepper noise (SPN) usually comes from the image sensor, transmission channel and decoding processing.The corrupted pixels take either maximum or minimum grey value, contributing to black and white dots on image.Most of tasks about computer vision, for example, image segmentation, feature extraction, image recognition, are strongly influenced by impulse noise.Therefore, it is necessary for removing the salt and pepper noise on image.
In the field of SPN reduction, most of the proposed methods are based on two phases method, namely, noise detection and filter.Currently, there are many noise detection and judgment methods, for example, Laplacian convolution [7], maximum gradient difference in window [5], minimum gradient difference in window [3].For the filter of the second phase removing SPN, many approaches are proposed in recently years.For example, the median filter (MF), the switch median filter [1], the adaptive median filter (AMF) [2], the noise adaptive fuzzy switching median filter (NAFSMF) [3], [6], [8], the adaptive weighted mean filter (AWMF) [4], the using long-range correlation filter (LRC) [9].Most of them are based on the improvement of traditional median filter or mean value in window.Thus, they will cause inevitably fuzzy edge in image restoration.Moreover, the size of filtering window has remarkable impact on the effect of SPN image filtering.There are many ways to choose size of filtering window, for example, , , , or even if the current filtering window does not have noise-free pixel, the filtering window will be expanded until .The way of keeping the same size of filtering window is clearly unreasonable.It is obvious that there are no enough clean pixels to restore the corrupted pixels in very high noise ratio window if choosing the window .However, if choosing a big filtering window ( ) or much larger one, that means amount of calculation in the low noise image recovering.Thus, how to choosing a most appropriate size of the window is very important for removing SPN in images.
In this paper, we proposed a new algorithm for SPN called the iterative restoration based on neighbourhood information.As we know, if the noise pixel has enough neighbourhood information, we can determine the corrupted pixel which belongs to edge area or flat area approximately, then based on this information, a perfect recovery can be achieved.When eight-neighbourhood information of the destroyed pixel are not complete or even are not available, the recovery needs through good blocks from global of image to assist the process.It will be an iteratively process until the eight-neighbourhood can remove noise pixels.The simple example is shown in Fig. 1.It is worth noting that the aforementioned algorithms may be bad in high or low SPN.But our present pattern has better recovery both in case of high or low SPN.The superiority of our algorithm is very obvious.
The rest of this paper is organized as follows.The Section II will give the details of proposed algorithm.The detection of noise level is first analyzed, and then the removing noise algorithm is proposed based on the neighbourhood pixels.And experiment results are conducted in Section III.The Section IV gives the conclusion.

II. PROPOSED ALGORITHM
Following, we will illustrate the algorithm from the choosing window, noise detection, iteratively removing noise with neighbourhood pixels.

A. Choosing a Window
Assuming that SPN is random distribution, and the ratio of noise is , . can be acquired from priori or according to the noise density of image.Select an window, the probability of pixel in window is , .It means the probability of all pixels are noise in window .For example, if , the probability of no undamaged in window 3 is .Then we can estimate the relationship among , and .The Table I shows the result.From the Table II, if selecting window, the window contains free noise pixels at least 99.9% when below 0.3.If selecting window, the window contains free noise pixels at least 99.9% when below 0.7.The formula of chosen window defined as If it is difficult to get value of , the default value of set 7.

B. Noise Detection
denotes the pixel value of coordinate on image.records whether noise-free pixel or not (0 means undamaged pixel, 1 means damaged pixel).For the SPN, how to further determine whether it is real noise becomes intractability.It has two cases shown in Fig. 2.
In the case of (1), there is no undamaged pixel to remove SPN.But in the previous step, we know the probability of containing uncorrupted pixels at least 99.9%.Therefore, it can be sure that the pixels in window are white block or black block.Updating the pixel at location using where is the number of pixel value for , is the pixels in window which centre of location .
In the case of (2), we use indicating the noise free pixels in window, defined as , calculating the mean of not maximum and minimum pixel values and standard deviation (SD) in window.which sets to smaller is reasonable, or according to algorithm of OTSU may be more accuracy.In this paper, we simply set .The detailed algorithm is as follows: Noise Detection Algorithm endif 10) else 11) 12) endif 13) end for

C. Noise Removing
Assuming that is the noise pixel at location .Its eight-neighbourhood is defined as Setting up eight windows centered as .They are respectively compared the window centered as , using the similarity between windows and weighted filtering.The similarity comparison is given as In this paper, is the pixels of window centered at , is the pixels of window centered as .For avoiding overflow and dividing by zero, the image pixels scaling to (0,1) before using formula (6), given as (7) sets a smaller value 0.001, avoiding equal to 0 or 1.
Taking partial derivatives of formula (6) (8) By letting formula (8) equals to zero.Then it can be obtained easily that the minimum value of formula ( 6) is 0 at .So the more similar between and , the smaller value of || .If , the graph shows as Fig. 3.
The similarity between window centered at and window centered at defined as From this equation, we can observe that the smaller , the stronger the correlation and the filtering will apt to use larger weight value.As shown in Fig. 4, illustrates the calculation of similarity between and with same location, where .It is noted that the calculation of similarity only uses clean pixels in window.

Let
denote filtering pixel value for the image , it can be defined as where In the formula (9), we could not consider the situation of , to illustrate this problem, given formula as It means the total number of undamaged pixels in same location between window centered at and window centered at .If , we do not compute .If , but , is set to the value of , is a very small value of 0.0001.If , i.e., the neighbourhood information is not enough for removing noise.The corrupted pixels at location will be recovered in the subsequent iterations.www.ijacsa.thesai.org The convergence condition is that any has not been updated in one iteration or any does not equal the initial value.If some equals initial value end of iteration, then the iteration is terminated.And is set to the mean of clean pixels ( ) in window centered at .

III. EXPERIMENTAL RESULTS
In our experiment tests, five different methods include median filtering (MF), NAFSMF [3], LRC [9], AMF [2], AWMF [4] are used to evaluate the performance of our proposed algorithm.The extensive experiments are conducted to verify the performance.In this paper, only the four tested images "Lena", "boat", "bridge" and "Elaine" are reported.All the image size is .We use peak signal to noise ratio (PSNR) to evaluate the performance of different methods.The PSNR is defined as where is the pixel value of original image.The Table II gives the results compared with other five different methods.From this table, proposed method achieves the best results in most of cases.Actually, there are only two cases which the proposed algorithm ranks the second position for 4 images with 9 noise levels.And the AWMF algorithm achieves the best results for the Bridge image with 80% and 90% noise levels.The black font in the table means the best results.In most of case, the proposed algorithm achieves the PSNR over 20 db even the noise level is larger than 90%.
Assuming that SPN is random distribution, the ratio between salt and pepper is 1, namely, the number of salt pixels is almost equal to that of pepper pixels.In Fig. 5, the original image with 90% SPN, the whole process of iteration is shown.The each iterated middle-result image with removing noise pixel by fully using neighbourhood information is shown, the progressive quality is rather obvious from the (a) to (f).The experimental results demonstrate that the method possesses good vision effect.In Fig. 6, we show the PSNR of different methods for "Lena" with 90 percent SPN.Obviously, MF, LRC, AMF and NAFSMF are not efficient for high noise ratio in image.But AWMF is not ideal for low noise ratio in image.The details of filtering results are in Table II.
In Fig. 7, we show the average time of different methods for image filtering.MF, NAFSMF, AWMF keep a low filtering time no matter noise ratio.Although more time than other when noise is high in our algorithm, the PSNR is highest from our filtering.From the trend of curve, our approach is reasonable.Because it is an iterative process, the process time will be longer with high SPN.

IV. CONCLUSIONS
In this paper, a highly efficient denoising method is presented no matter high or low SPN.It is an iterative process by effectively using neighbourhood information and global information.Our present pattern has a better recovery both in case of high or low SPN by experiment.Importantly, our ideal is novel in the field of SPN and obtained good result.In addition, the method can also be used in 3D models by simple extension.The future work includes how to apply this algorithm into the practical application, especially the depth image denoising and 3D points denoising.In addition, how to accelerate the speed is also another research point.

Fig. 1 .
Fig. 1.The noise pixel and neighbourhood information recovery process.

Fig. 2 .
Fig. 2. Two cases of extreme value in window.

Fig. 7 .
Fig. 7.The average time of different methods for tested images.
This work is partially supported by the Science Research Foundation of Daqing Normal University under Grant No.14ZR02.www.ijacsa.thesai.org

TABLE II .
RESULT OF PSNR (DB) FOR DIFFERENT ALGORITHM WITH VARIOUS NOISE LEVEL