A Spatial Median Filter for Noise Removal in Digital Images

0 downloads 0 Views 170KB Size Report
A Spatial Median Filter for Noise Removal in Digital Images. James Church, Dr. Yixin Chen, and Dr. Stephen Rice. Computer Science and Information System, ...
A Spatial Median Filter for Noise Removal in Digital Images James Church, Dr. Yixin Chen, and Dr. Stephen Rice Computer Science and Information System, University of Mississippi [email protected],{ychen,rice}@cs.olemiss.edu

Abstract In this paper, six different image filtering algorithms are compared based on their ability to reconstruct noiseaffected images. The purpose of these algorithms is to remove noise from a signal that might occur through the transmission of an image. A new algorithm, the Spatial Median Filter, is introduced and compared with the current image smoothing techniques. Experimental results demonstrate that the proposed algorithm is comparable to popular image smoothing algorithms. In addition, a modification to this algorithm is introduced to achieve more accurate reconstructions over other popular techniques.

1. Smoothing Algorithms The inexpensiveness and simplicity of point-andshoot cameras, combined with the speed at which budding photographers can send their photos over the Internet to be viewed by the world, makes digital photography a popular hobby. With each snap of a digital photograph, a signal is transmitted from a photon sensor to a memory chip embedded inside a camera. Transmission technology is prone to a degree of error, and noise is added to each photograph. Significant work has been done in both hardware and software to improve the signal-to-noise ratio in digital photography. In software, a smoothing filter is used to remove noise from an image. Each pixel is represented by three scalar values representing the red, green, and blue chromatic intensities. At a pixel studied, a smoothing filter takes into account the pixels surrounding it in order to make a determination of a more accurate version of this pixel. By taking neighboring pixels into consideration, extreme “noisy” pixels can be filtered out. Unfortunately, extreme pixels can also represent original fine details, which can also be lost due to the smoothing process. This paper will examine four common smoothing algorithms and introduce a new smoothing algorithm.

Each of the algorithms covered can be applied to one dimensional as well as two dimensional signals. Figure 1 demonstrates five common filtering algorithms applied to an original image.

(a)

(b)

(c)

(d)

(e)

(f)

Figure 1. Examples of common filtering approaches. (a) Original Image (b) Mean Filtering (c) Median Filtering (d) Root signal of Median Filtering (e) Component-wise Median Filtering (f) Vector Median Filtering The simplest of smoothing algorithms is the Mean Filter as defined in (1). The Mean Filter is a linear filter which uses a mask over each pixel in the signal. Each of the components of the pixels which fall under the mask are averaged together to form a single pixel. This new pixel is then used to replace the pixel in the signal studied. The Mean Filter is poor at maintaining edges within the image.

MEANFILT ER(x1 , ..., xN ) =

1 N ∑ xi N i=1

(1)

The median is a statistical concept whereby in a given sorted list of numbers, the median is the center value of the list. The use of the median in signal processing was first introduced by J. W. Tukey[1]. If the count of the list is even, there could be multiple center values. If the count of the list is odd, there is one unique median value; therefore, it is convenient to use odd list

sizes when looking for a median. The Median Filter is performed by taking the magnitude of all of the vectors within a mask and sorting the magnitudes, as defined in (2). The pixel with the median magnitude is then used to replace the pixel studied. The Simple Median Filter has an advantage over the Mean filter in that it relies on median of the data instead of the mean. As single noisy pixel present in the image can significantly skew the mean of a set. The median of a set is more robust with respect to the presence of noise. MEDIANFILT ER(x1 , ..., xN ) = MEDIAN(kx1 k2 , ..., kxN k2 )

(2)

When filtering using the Simple Median Filter, an original pixel and the resulting filtered pixel of the sample studied are sometimes the exact same pixel. A pixel that does not change due to filtering is known as the root of the mask. It can be shown that after sufficient iterations of median filtering, every signal converges to a root signal[3]. The Component Median Filter, defined in (3), also relies on the statistical median concept. In the Simple Median Filter, each point in the signal is converted to a single magnitude. In the Component Median Filter each scalar component is treated independently. A filter mask is placed over a point in the signal. For each component of each point under the mask, a single median component is determined. These components are then combined to form a new point, which is then used to represent the point in the signal studied. When working with color images, however this filter regularly outperforms the Simple Median Filter. When noise affects a point in a grayscale image, the result is called “salt and pepper” noise. In color images, this property of “salt and pepper” noise is typical of noise models where only one scalar value of a point is effected. In this noise model, the Component Median Filter is more accurate than the Simple Median Filter. The disadvantage of this filter is that it will create a new signal point that did not exist in the original signal, which may be undesirable in some applications. 

 MEDIAN(x1r , ..., xNr ) CMF(x1 , ..., xN ) =  MEDIAN(x1g , ..., xNg )  (3) MEDIAN(x1b , ..., xNb ) The Vector Median Filter was developed by Astola, Haavisto, and Neuvo in 1990[2]. In the Vector Median Filter (4), a filter mask is placed over a single point. The sum of the vector magnitude differences using the L2 norm from each point to each other point within the mask is computed. The point with the minimum sum of vector differences is used to represent the point in

the signal studied. The Vector Median Filter is a wellresearched filter and popular due to the extensive modifications that can be performed in conjunction with it. N

N

i=1

i=1

V MF(x1 , ..., xN ) = MIN( ∑ kx1 − xi k, ..., ∑ kxN − xi k) (4) For each of the four algorithms discussed, experimental results will be shown that indicate which algorithm is best suited for the purpose of impulse noise removal in digital color images. Those results will be compared to two new algorithms for noise removal: the Spatial Median Filter and the Modified Spatial Median Filter. In testing, we consider sets of images containing various amounts of artificial noise. Impulse noise represents random spikes of energy that happen during the data transfer of an image. When applying noise, a percentage of the image is damaged by changing a randomly selected point channel to a random value from 0 to 255. The noise model, Inoisy , is given by    

x≥p x