## A Robust De-Noising Model for Image Enhancement with Adaptive Median Filtering

Department of Computer Science and Engineering, Jahangirnagar University, Dhaka, Bangladesh### Abstract

This paper presents a robust de-noising model for image enhancement using adaptive median filtering. In this approach image noise is detected with a standard median filter using an adaptive window. Within the window, the original value of the center pixel is changed to a newer that is closer to or same as the standard median. A comparison has been arranged among the proposed method, the standard median (SM) filter and the center weighted median (CWM) filter, which proves the superiority of the proposed filtering method.

### At a glance: Figures

**Keywords:** de-noising model, image enhancement, adaptive window, adaptive median filter

*American Journal of Modeling and Optimization*, 2014 2 (3),
pp 69-72.

DOI: 10.12691/ajmo-2-3-1

Received May 23, 2014; Revised June 11, 2014; Accepted June 11, 2014

**Copyright**© 2014 Science and Education Publishing. All Rights Reserved.

### Cite this article:

- Chowdhury, M. Mozammel Hoque. "A Robust De-Noising Model for Image Enhancement with Adaptive Median Filtering."
*American Journal of Modeling and Optimization*2.3 (2014): 69-72.

- Chowdhury, M. M. H. (2014). A Robust De-Noising Model for Image Enhancement with Adaptive Median Filtering.
*American Journal of Modeling and Optimization*,*2*(3), 69-72.

- Chowdhury, M. Mozammel Hoque. "A Robust De-Noising Model for Image Enhancement with Adaptive Median Filtering."
*American Journal of Modeling and Optimization*2, no. 3 (2014): 69-72.

Import into BibTeX | Import into EndNote | Import into RefMan | Import into RefWorks |

### 1. Introduction

Image de-noising or filtering is a technique to reduce noises from a corrupted image. In many applications of image processing, the input image may be corrupted by noise and thus may not show the features or colors clearly. Thus, a major task in image processing is to extract information from the noisy images. The main objective of image filtering is to improve contrast of the image or perception of information in images for human viewers, or to provide better input for other automated image processing techniques. By image filtering some sort of enhancement in images can be achieved. Here, each pixel in the output image is computed as a function of one or several pixels in the original image, usually located near the location of the output pixel. Image filtering can be very useful in many applications like machine vision, robot navigation, aircrafting, digital mammography and so on ^{[1]}.

Digital images may be contaminated by a variety of noise sources. Impulse noise is one most common kind of noise that usually occurs when we transform digital image data through electronic communication channel and it is caused by unstable voltage such as lightning. It changes some bits or pixels of an image and can sometimes turn a white spot into black or black into white. If it happens to a gray-level image, the affected pixel values will change into other values randomly distributed between 0 and 255, and the changed spots would look like a nevus popped up on someone’s face or sands fall on a white paper.

Some researchers have proposed de-noising algorithms for removal of this kind of noise to enhance image quality, such as the median filter ^{[2]}, the weighted median filter ^{[3]}, the center weighted median filter ^{[4]}, the tri-state median filter ^{[5]}, the noise adaptive soft-switching median filter ^{[6, 7, 8]} and others [9-18]^{[9]}. From the study of these researches, it is evident that the median filter is a useful technique to resist the effect of impulse noise on an image. This research proposes a new adaptive median filter that incorporates the mechanism of standard median filtering and an adaptive window.

This article is structured as follows: Section 2 describes the median filtering technique, Section 3 presents the proposed filtering method, Section 4 demonstrates experimental results and discussions. Finally, Section 5 concludes the paper.

### 2. Median Filtering

Median filter is a popular low-pass filter, attempting to remove noisy pixels while keeping the edge intact ^{[19]}. Average filtering or Gaussian smoothing will tend to blur edges because the high frequencies in the image are attenuated. However, the median is a more robust average than the mean and so a single very unrepresentative pixel in a neighborhood will not affect the median value significantly. Median filters are great at preserving edges and eliminating impulse noise. The values of the pixel in the window are stored and the median – the middle value in the sorted list (or average of the middle two if the list has an even number of elements)-is the one plotted into the output image. The median filtered image *g*(*x*, *y*) can be obtained from the median pixel values in a neighborhood of (*x*, *y*) in the input image* **f*(*x*, *y*), as defined by the following formula:

(1) |

For example, consider a 3x3 window of pixels of a noisy image as shown in Figure 1. The noisy pixel value 58 will be replaced by the median pixel value.

**Fig**

**ure**

**1**

**.**

**The Median filtering operation**

Here,

Unsorted array: 66 51 48 43 58 56 40 30 50

Sorted array: 30 40 43 48 50 51 56 58 66

Median of this array is: 50

So, the candidate noisy pixel value 58 is replaced with the value of 50. Similarly we can replace all noisy pixel values of the original (noisy) image and get a median filtered image.

### 3. Proposed Adaptive Median Filtering Algorithm

This section describes the proposed adaptive median filtering method for removal of impulse noise from the images. This filter employs the standard median filtering technique and considers a variable or adaptive window for selecting neighboring pixels in the image. The algorithm includes the following steps:

1. An *n×n* window (or subimage) is taken on the original image.

2. The gray values of the neighborhood pixels within the window are stored in an array.

3. Then, the pixel values are sorted in ascending or descending order.

4. The median value (*I*_{med}) is selected from the sorted pixel values. The median is the middle value in the sorted list (or average of the middle two if the array has an even number of elements).

5. Now, the adaptive median value (*I*_{am}) is selected according to the following steps and placed as output:

a) if *I*_{min} < *I*_{med }< *I*_{max}, then go to step 6.

else increase the window size.

b) if window size ≤ *S*_{max}, repeat steps 2 to 5.

else go to step 6.

6. Output *I*_{am} =* I*_{med}_{. }

7. Repeat steps 1 to 6 across the whole image.

Here,

*W*_{xy}_{ }=_{ }the window or sub-image centered at location (*x*,*y*)

*I*_{min} = minimum intensity value in *W*_{xy}

*I*_{max}_{ }= maximum intensity value in *W*_{xy}

*I*_{med }= median of the intensity values in *W*_{xy}_{ }

*I*_{am} = adaptive median of the intensity values in *W*_{xy}

*I*_{xy} = intensity value at coordinates (*x*, *y*).

*S*_{max}_{ }= maximum window size of the adaptive filter.

### 4. Results and Discussions

A new adaptive median filtering method for image de-noising has been proposed and implemented in this research. The effectiveness of the proposed method has been justified using different noisy images. The algorithm has been implemented using Visual C++ on an Intel Core i3 3.3 GHz PC with 4 GB RAM. The test images are captured with a SONY VISCA camera. Figure 2** **shows an original test image, a noised image and the corresponding filtered images with different methods. Another experimental result with adaptive median de-noising method is shown in Figure 3 It is evident that the output image processed by the proposed method is improved compared to others.

**Figure**

**2**

**.**

**The test (baby) image, noised image with 20% additive noise, and the output images for different filtering methods**

**Figure**

**3**

**.**

**Adaptive Median De-noising with Lena image.**

To justify the effectiveness of the proposed algorithm, several quality measurement variables like peak signal to noise ratio (PSNR) and mean square error (MSE) have been estimated. Assume M×N initial image *f*(*x*, *y*), noised image *f *'(*x*, *y*), then the measure of peak signal-to-noise ratio (PSNR) can be defined by the following formula:

(2) |

and, mean square error (MSE) is given by,

(3) |

**Figure**

**4**

**.**Comparison of different filtering methods

Table 1 demonstrates the performance of the proposed technique compared to other techniques. A comparison of PSNR for the filtered images with standard median, center weighted median and proposed filtering methods is illustrated in Figure 4. This method can successfully reduce noises from the image especially corrupted by impulse noise.

Figure 5 shows the impact of mask or window size on output image (for baby image) using the proposed adaptive median filter, which reveals that a 3x3 mask is suitable for selecting the neighborhood pixels.

**Figure**

**5**

**.**Impact of mask or window size on output image (for baby image).

### 5. Conclusions

In this paper, a new adaptive median filtering method is proposed. This filter is used to redeem the damage caused by the impulse noise that occurs when we transform a digital image data in any kind of electronic communication channel.

The effectiveness of the proposed filtering method has been tested with different types of gray scale images with simple and complex backgrounds. Experimental results predict that the proposed filtering model has better performance in image de-noising. The next approach is to extend the algorithm for color images.

### References

[1] | A. Polesel, G. Ramponi, and V. J. Mathews, “Image enhancement via adaptive unsharp masking,” IEEE Trans. Image Processing, vol. 9, pp. 505-510, Mar. 2000. | ||

In article | CrossRef | ||

[2] | B. Singh, R. Singh and H. Singh, “Removal of High Density Salt & Pepper Noise in Noisy color Images using Proposed Median Filter”, International Journal of Advanced Research in Computer Science and Electronics Engineering (IJARCSEE, Vol. 2, Issue 2, pp. 253-256, 2013 | ||

In article | |||

[3] | T. Loupas, W. N. McDicken, and P. L. Allan, “An adaptive weighted median filter for speckle suppression in medical ultrasonic images,” IEEE Transactions on Circuits and Systems, Vol. 36, Jan. 1989. | ||

In article | CrossRef | ||

[4] | S. J. Ko and Y.H Lee, “Center weighted median filters and their applications to image enhancement,” IEEE Transactions on Circuits and Systems, Vol. 38, pp. 984-993, 1991. | ||

In article | CrossRef | ||

[5] | T. C. Chen, K. K. Ma and L. H. Chen, “Tri-state median filter for image de-noising,” IEEE Transactions on Image Processing, Vol. 8, No. 12, pp. 1834-1838, Dec. 1999. | ||

In article | CrossRef | ||

[6] | H. L. Eng and K. K. Ma, “Noise adaptive soft-switching median filter,” IEEE Transactions on Image Processing, Vol. 10, No. 2, pp. 242-251, Feb. 2001. | ||

In article | CrossRef | ||

[7] | W. Ping, L. Junli, L. Dongming, and C. Gang, “A fast and reliable switching median filter for highly corrupted images by impulse noise,” in Proceeding IEEE International Symposium on Circuits and Systems, pp. 3427-3430, May 2007. | ||

In article | |||

[8] | Donoho D. L., “De-Noising by Soft-Thresholding”. IEEE Trans. Information Theory, 41 (3):613-627, 1995. | ||

In article | CrossRef | ||

[9] | T. Zong, H. Lin, and T. Kao, “Adpative local contrast enhancement method for medical images displayed on a video monitor,” Med. Eng. Phys., vol. 22, pp. 79-87, 2000. | ||

In article | CrossRef | ||

[10] | Maaten Jansen, Empirical bayes approach to improve wavelet thresholding for image noise reduction, Journal of the American Statistical Association, 96 (454): 629-640, 2001. | ||

In article | CrossRef | ||

[11] | V. Strela, P. N. Heller, G. Strang, “The application of multiwavelet filterbanks to image processing”, IEEE Trans. Signal Processing, 8 (4): 548-563, 1999. | ||

In article | |||

[12] | S. S. Agaian, K. Panetta, and A. M. Grigoryan, “Transform-based image enhancement algorithms with performance measure,” IEEE Trans. Image Processing, vol. 10, pp. 367-382, Mar. 2001. | ||

In article | CrossRef | ||

[13] | A. Polesel, G. Ramponi, and V. J. Mathews, “Image enhancement via adaptive unsharp masking,” IEEE Trans. Image Processing, vol. 9, pp. 505-510, 2000. | ||

In article | CrossRef | ||

[14] | M.H. Chowdhury, M. E. Islam, N. Begum, and M.A. Bhuiyan, “Digital Image Enhancement with Fuzzy Rule-based Filtering”, 10th International Conference on Computer and Information Technology, pp. 250-252, Dhaka, Bangladesh. 2008. | ||

In article | |||

[15] | A.K.M. Zaidi Satter and M. Mozammel Hoque Chowdhury, “A Fuzzy Algorithm for De-Noising of Corrupted Images”, International Journal of Computer Information Systems, Vol. 6, No. 4, 2013. | ||

In article | |||

[16] | F. Farbiz et al. “A new fuzzy logic filter for image enhancement,” IEEE Trans. Systems Man and Cybernetics-Part B, vol. 30 (1), pp. 110-119, 2000. | ||

In article | CrossRef | ||

[17] | J. Portilla, V. Strela, M. Wainwright, and E. Simoncelli, “Image denoising using scale mixtures of Gaussians in the wavelet domain,” IEEE Trans. Image Proc., vol. 12, no. 11, pp. 1338-1351, 2003. | ||

In article | CrossRef | ||

[18] | S. G. Chang, B. Yu, and M. Vetterli, “Spatially adaptive wavelet thresholding with context modeling for image denoising,” IEEE Trans. on Image Processing, vol. 9, no. 9, pp. 1522-1531, 2000. | ||

In article | CrossRef | ||

[19] | R.C. Gonzalez and R. E. Woods, “Digital Image Processing”, 3rd Edition, Pearson Education Inc. 2008. | ||

In article | |||

[20] | S. Nagabhushana, “Computer Vision and Image Processing”, New Age International (P) Limited, 2005. | ||

In article | |||