# Introduction mpulse noise is a special type of noise where the intensity of the corrupted pixels has the tendency of being either relatively high or low [1]. The principal sources of impulse noise in digital images arise due to transmission errors, faulty memory locations or timing errors in analog-to-digital conversion [2]. Salt-andpepper noise, a special case of impulse noise is the phenomenon where a certain percentage of individual pixels of an image are randomly digitized into the two extreme (maximum and minimum) intensities in the here dynamic range [3]. It is named 'salt-and-pepper' because of its appearance as white and black dots superimposed on the corrupted image [4].The presence of salt-and-pepper noise in digital image can severely damage image details and information. Therefore, removal of this type of noise is an important is an important issue in order to perform further processing on an image and it is critical for the extraction of reliable and accurate information from a digital image [5]. Nonlinear filtering techniques are implemented widely because of their superior performance in removing saltand-pepper and also preserving fine details of image while linear filters perform weakly and create blurring effect. Several researches on this area have been done to modify non-linear filters and to develop more efficient algorithm in removing this kind of noise from a digital image. In this paper, a developed algorithm has been proposed which exhibits better result than some recent techniques. In the next few sections of this paper, a study on the recently developed works will be discussed including some traditional adaptive filtering techniques as well. After that the proposed technique will be illustrated in details with the performance analysis followed by that. # II. # Some Existing Noise removal techniques Standard Median Filtering is the simplest nonlinear technique where the value of each pixel is replaced by the median of the gray levels in the neighborhood of the corresponding pixel [4] regardless of whether it is corrupted or not. SMF is ineffective in presence of high density noise and exhibits blurring of the filtered image if the window size is large [2]. For noise level over 50% it fails to preserve the edge details of the original image [6]. Different techniques have been proposed to improve the performance of median filtering, such as the Weighted Median Filter (WMF) [7], the Center Weighted Median Filter (CWMF) [8], and the Recursive Weighted Median Filter (RWMF) [9]. In these methods weights are assigned to the pixels covered by the processing window. Regardless of considering corrupted or uncorrupted pixels, these methods apply modification on the centre pixels of the window and the local features are not considered. Therefore, when the noise level is high, these filters fail to recover the details and edges satisfactorily [10]. Some research works deal with distinguishing between corrupted and uncorrupted pixels in order to further process such as Adaptive Median Filter (AMF) [11]. The basic difference between the AMF and the SMF is that, the AMF changes the window size during the filtering operation, depending on the noise density of the image. The variation of this window size depends on the median value of the graylevels in the local neighborhood. The AMF starts with a 3×3 window and checks the value of the median in the corresponding neighborhood. If the median value is found to be an impulse, then the window size is increased and the process is repeated until a noise-free median value is found or the size of the filtering window reaches a threshold [5]. The other such techniques are the Tri-State Median Filter (TSMF) [12], the Progressive Switching Median Filter [13], the Multi-State Median Filter (MSMF) [14], and the Noise Adaptive Soft Switching Median Filter (NASSMF) [15] where corrupted pixels are selected for processing and uncorrupted ones are left unchanged. These techniques are effective for removing salt-and-pepper noises up to medium range of density. Furthermore, a two-stage Noise Adaptive Fuzzy Switching Median filter (NAFSM) has been proposed in [3], where the noise detection stage utilizes the histogram of the corrupted image to identify the noise pixels first. Then, the second stage of filtering process employs fuzzy reasoning to process the noise pixels only. Thus, this method handles the uncertainty present in the extracted local information, which was introduced by noise [5]. Besides, another kind of techniques have been developed where the sum of the distances between each vector pixel and the other vector pixels in the window is calculated for further processing such as Vector Median Filter (VMF) [16], Improved Vector Median Filter [17] and Enhanced Adaptive Vector Median Filter (EAVMF) [18]. In the EAVMF [18] a single last processed pixel is taken into account in case of extremely high density of salt-andpepper noise. Besides, the Decision Based Algorithm (DBA) [2] has been proposed where only noisy pixels are replaced by the median value or by the mean of the previously processed neighborhood pixel values. However, at higher noise densities, it is likely that the median value is also a noise. Therefore, this method produces streaking when the noise density is high [5]. In [10], a Non-linear Adaptive Statistics Estimation Filter has been proposed to remove high density Salt-and-pepper noise, which reduces streaking at higher noise densities [5], but the image details is disturbed after the filtering process. In case of worst case situation, the concept of considering last processed pixel has been adopted by several researches where the centre pixel of the processing window is replaced with the previously processed value of the pixel. EDBAMF [19] has been developed based on the above method of using last processed pixel. Moreover, in this approach an assumed threshold value is used to determine the pixel value in case of extreme situation. Image quality is degraded in the filtered image after applying EDBAMF. Recently, Enhanced Non-Linear Adaptive Filtering Technique (ENLAFT) [5] has been proposed which seeks for uncorrupted median in the processing window and continues to increase window until a noise-free median is found. After reaching the maximum allowable size, the technique does not expands its window and it considers the last processed pixel obtained from previous iteration. Decision is taken using statistical analysis on local features in order to use the last processed pixel. The techniques depending on a single last processed pixel may create streaking on the output image and thus decrease the image quality. Fig. 2 shows an example of streaking on image. Furthermore, depending on a single last processed pixel leads these algorithms to have a weak decision in case of extreme level of noise density while other previously processed pixels are not taken into account. In this paper, we present an improved approach to remove high density salt-and-pepper noise which overcomes the problems faced in other existing nonlinear filtering methods. Drawbacks of depending on a single last processed pixel have been relaxed in this method where multiple last processed pixels obtained from previous steps are used for further decision making and processing. The proposed technique is able to reduce the occurrence of streaking on output image because the method does not depend on a single last processed pixel. Simulation applied on several input images exhibits satisfactory result and proves that the proposed method performs better than the other nonlinear filtering techniques in removing salt-and-pepper up to 95% level of noise density. # Multiple last processed pixels The proposed method deals with multiple last processed pixels. This section of the paper will explain the concept of obtaining multiple last processed pixels and estimating values using them. As mentioned before, the last processed pixel is obtained from the value that has been estimated from the previous iteration. In this case, the direction of image scanning is an important issue. To get an example, let X be an input grayscale image of size m×n. We know that any filtering procedure is done by sliding the window mask in every iteration on X from pixel to pixel keeping current processing pixel X(i,j) at the centre of the window, where i = 1,2,3?m and j = 1,2,3,?.n. By convention, sliding starts from the first pixel of an image which is located at X(1,1) and it will be under processing. Let Y be the output matrix (initialized as an empty matrix) where the processed pixel obtained from all iterations are stored. Suppose X(i,j) is current centre pixel, so its processed value will be stored at Y(i,j), Similarly, after sliding to the next pixel X(i,j) where j=j+1, the processed value will be stored at Y(i,j) where j=j+1 and so on. If any pixel is needed to be left unchanged, then Y(i,j) would be equal to X(i,j) directly. In this manner the whole X will be scanned through X(1,1) to X(m,n) and simultaneously Y will be constructed with processed pixels as well. Here, we can see that if X(i,j) is a current pixel then its last processed pixel is Y(i,j-1). The concept of a single last pixel can be visualized from Fig. 3 where filter scanning direction starts from upper left corner of an image X(1,1) and ends at X(m,n). In case of multiple last processed pixel, only Y(i,j-1) is not selected, rather more than one pixels in Y are considered. Assuming that, conventional scanning direction is applied (from upper-left to lower-right) and for a current pixel X(i,j) at any iteration, we can consider four last processed pixel within a 3×3 mask from Y which are Y(i,j-1), Y(i-1,j-1), Y(i-1,j) and Y(i-1,j+1). The other remaining four pixels in Y covered by that window will not be considered because they have not been processed yet. The concept is shown in Fig. 4 (a). The remaining last four processed pixel can be obtained through a reverse-direction scanning on X. That means the sliding procedure will start from X(m,n) and end at X(1,1). In this manner Y(i,j+1), Y(i+1,j+1), Y(i+1,j) and Y(i+1,j-1) are the last processed pixels for X(i,j) and similarly the other remaining pixels will not be selected. Fig. 4 (b) shows the idea. Overall, we need to filter the image twice (2 nd one has the opposite direction of the other) in order to select multiple last processed. For a pixel P, let L 1 be the set of last processed pixels obtained from forward scanning (from upper-left to lower-right) and L 2 be the set of last processed pixels obtained from reverse scanning (lower-right to from upper-left). Then the set of all the selected last processed pixels L P can be determined by combining both the elements of L 1 and L 2 . # IV. # Proposed technique The proposed method takes X as an input image of size M×N. A sliding window W of size (2a+1) × (2a+1) is defined where X(i,j) at the centre of W. The algorithm starts with a=1 from X(1,1) and checks whether X(i,j) is noisy (0 or 255) or not. If it is noise-free, W slides to next pixel and starts processing again. If X(i,j) is noisy then the neighborhood pixels are checked and among them only the noise-free neighborhoods are selected as the candidates for calculating median. The centre pixel X(i,j) is then replace with the median calculated from noise-free neighbors. If no noise-free neighbors is found in the current window, then W is expanded by incrementing a by 1 and the algorithm again seeks for noise-free pixels within the window area. This expansion process is continued up to a maximum window size W MAX . After reaching W MAX , the proposed technique does not expand its W anymore. This is the worst case scenario where no noise-free pixel exists within a maximum defined window. In this situation, set L 1 for the current pixel X(i,j) is determined and the current centre pixel X(i,j) is marked and its location is stored in order to processing later. In this procedure, the entire image is filtered by scanning once. The set L 2 for a pixel X(i,j) is determined from reverse scanning in similar procedure and as mentioned in previous section X(i-1, j-1) X(i-1,j) X(i-1, j+1) X(i,j- 1) X(i,j) X(i,j+1) X(i+1, j-1) X(i+1,j) X(i+1, j+1) (a)Y(i-1, j-1) Y(i-1,j) Y(i-1, j+1) Y(i,j-1) Y(i,j) Y(i,j+1) Y(i+1, j-1) Y(i+1,j) Y(i+1, j+1) (b) Fig. 3 : a) Shows current centre pixel X(i,j) and b) Shows its last processed pixel Y(i,j-1) Fig. 4 : Multiple last processed pixel in a 3×3 window for the centre pixel shown in Fig. 3(a). Blue colored pixels are selected as last processed pixel in (a) and in (b) Red colored pixels are selected as last processed pixel for reverse -direction scanning the set of selected last processed pixels L P for a pixel X(i,j) can be determined using L 1 and L 2 . Finally, median is calculated from the values of L P and the marked pixel X(i,j) is then replaced with that median value. Y(i-1, j-1) Y(i-1,j) Y(i-1, j+1) Y(i,j-1) Y(i,j) Y(i,j+1) Y(i+1, j-1) Y(i+1,j) Y(i+1,j+1) (a)Y(i-1, j-1) Y(i-1,j) Y(i-1, j+1) Y(i,j- 1) Y(i,j) Y(i, j+1) Y(i+1, j-1) Y(i+1,j) Y(i+1,j+1) (b) ( D V. # Simulations The performance of the proposed algorithm is tested with different grayscale and color images using MATLAB. The Peak-Signal-to-Noise Ratio (PSNR), Mean Square Error (MSE), and Image Enhancement Factor (IEF) evaluation schemes are used to quantitatively assess the strength and quality of the restored images, where- (1) ? ? ? ? ? ? ? ? ? ? MSE PSNR? ? ? ? ? j i j i j i x y MN MSE , 2 , , 1(2)? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? j i j i j i Y j i Z j i Y j i X IEF , 2 , 2 , , , ,(3)? ? ? j i ij ij x y MN MAE , 1(4) Here, X denotes the original image, Y denotes the corrupted image, Z is the restored image, and MN is the total number of pixel in the image. In our experiment, a total of 2 standard test images (Lena and Baboon) frequently used in literature are selected and contaminated with salt-and-pepper noise ranging from 10% to 95%. These images contain various characteristics, which are suitable for analyzing filtering performance. The performance of the proposed algorithm (PA) is compared with some state-of-the-art filters, namely AMF [11], DBA [2], NAFSMF [3], EDBAMF [19] and ENLAFT [5] based on the above parameters. Table 1-2 shows performance analysis of different algorithms for removing noise at different noise levels. In Table 1, different values exhibit that proposed algorithm performs better than the others by showing higher PSNR at different noise levels. In comparisons of MAE values among the algorithms, proposed algorithm shows satisfactory result which is shown is Table 2. Fig. 5 exhibits the analysis of IEF for the algorithms and the proposed approach is also significant in this case. Fig. 6-7 shows visual inspections performed on the filtered images in order to judge the effectiveness of different algorithms. ![Fig.1 : a) Shows an original image and b) Is the image corrupted by salt-and-pepper noise](image-2.png "") ![Fig. 2 : a) Original image and b) Image corrupted by salt-and-pepper noise c) Occurrence of streaking after filtering with considering single last processed](image-3.png "") ![Filtering Technique to Remove High Density Salt-and-Pepper Noise Using Multiple Last Processed Pixels](image-4.png "") 565![Fig. 5 : IEF values for different algorithms for Baboon image at different noise level](image-5.png "Fig. 5 :Fig. 6 :Fig. 5 :") 1Noiselevel (%)SMFAMFDBANAFSMFEDBAMFENLAFTPA1033.9 41.8 31.7 42.6 40.1 43.4 44.92029.6 37.2 29.3 38.7 36.5 39.6 40.23024.1 34.3 26.5 36.3 34.3 36.9 37.74019.1 32.1 23.6 34.3 32.6 35.1 36.25015.3 29.9 21.1 32.5 31.0 33.5 34.16012.3 27.4 19.0 30.8 29.6 31.9 33.7709.922.2 17.3 29.3 28.3 30.4 31.6808.016.3 15.5 27.4 26.7 28.6 30.1906.510.5 13.7 23.7 24.4 26.0 27.9 2Noiselevel (%)SMFAMFDBANAFSMFEDBAMFENLAFTPA102.70.41.60.40.50.30.3203.40.92.20.81.10.70.5304.91.53.41.31.71.20.9408.92.25.41.82.41.71.45016.73.08.52.43.22.21.86029.24.112.53.14.02.82.37047.46.817.74.05.13.62.78070.915.125.35.16.44.73.89098.143.336.17.58.66.45.1 © 2012 Global Journals Inc. (US) Global Journal of Computer Science and Technology * the International MultiConference of Engineers and Computer Scientists I * Noise Adaptive Fuzzy Switching Median Filter for Salt-and-Pepper Noise Reduction KK VToh NA MIsa IEEE Signal Processing Letters 17 3 2010 * RCGonzalez REWoods Digital Image Processing Pearson Education 2004 2nd edition * An Enhanced Non-Linear Adaptive Filteing Technique for Removing High Density Salt-and-Pepper Noise MMRahman FAhmed MIJubair SAPriom IMZiko International Journal of Computer Applications 38 11 2012 * Salt and Pepper Noise Removal by Median Type Noise Detectors and Detail-Preserving Regularization RHChan CWHo MNikolova IEEE Transactions on Image Processing 14 10 2005 * The weighted median filter DR KBrownrigg Communication, ACM 27 8 1984 * Center weighted median filters and their applications to image enhancement SJKo YHLee IEEE Transactions on Circuits Systems 38 9 1991 * Recursive Weighted Median Filters Admitting Negative Weights and Their Optimization GArce JParedes IEEE Transactions on Signal Processing 48 3 2000 * High Density Salt and Pepper Noise Removal in Images using Improved Adaptive Statistics Estimation Filter VJayaraj DEbenezer KAiswarya International Journal on Computer Science and Network Security 9 11 2009 * Adaptive edian filters: new algorithms and results HHwang RAHaddad IEEE Transactions on Image Processing 4 4 1995 * Tri-State Median Filter for Image Denoising TChen KKMa LHChen IEEE Transactions on Image Processing 8 8 1999 * Progressive switching median filter for the removal of impulse noise from highly corrupted images ZWang DZhang IEEE Transactions on Circuits and Systems II 46 1999 * Space Variant Median Filters for the Restoration of Impulse Noise Corrupted Images TChen HRWu IEEE transactions on circuits and systems II: analog and digital signal processing 2001 48 * Noise Adaptive Soft-Switching Median Filter HLEng KKMa IEEE Transactions on Image Processing 10 2 2001 * Removal of impulse noise from color image RHLaskar BBhowmick RBiswas SKar IEEE Region 10 Conference 2009. 2009 -2009 * Improved Vector Median Filtering Algorithm for High Density Impulse Noise Removal in Microarray Images VAnjireddy JVasudevarao Global Journal of Computer Science and Technology 12 2 2012 * An Enhanced Adaptive Vector Median Filtering Technique to Remove High Density Salt-and-Pepper Noise from Microarray Image MIJubair MDey International Journal of Computer Applications 45 13 2012 * An enhanced decision based adaptive median filtering technique to remove Salt and Pepper noise in digital images MIJubair MMRahman SAshfaqueuddin IMZiko Identifier: 10.1109 /ICCITechn.2011.6164827 14th International Conference on Computer and Information Technology (ICCIT) 2011 Digital Object