CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO...

18
135 CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE MIXED NOISE WITH EDGE PRESERVATION 8.1 INTRODUCTION Noise cancellation is an important step in image processing and many algorithms have been proposed to solve this problem. The algorithms used for noise cancellation mainly depend on the types of noise in images. For example, in image acquisition step, the photoelectric sensor introduces the white Gaussian noise due to the thermal motion of electrons. With the unstable network transfer, impulse noise is added into the image. In many applications, these two types of noise are present in the image together named as mixed noise. Mixed noise could occur when sending an already corrupted image over a noisy communication channel. Neither mean filter nor median filter alone can efficiently reduce the mixed noise. There are many mixed noise removal methods presented in recent literatures. A hybrid filter (Peng and Lucke 1995) that consists of a nonlinear filter and a weighted linear filter is proposed to reduce the mixed noise. A combination of mean and median filter (Khriji and Gabbouj 1998, and Rabie 2004) has been reported to suppress the mixed noise. A histogram based fuzzy filter (Wang et al 2002) has been proposed to remove the heavy tailed and Gaussian noise. Three filters (Chio and Krishnapuram 1997) were introduced for removing impulse noise, smoothing out non-impulse noise and enhancing

Transcript of CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO...

Page 1: CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO …shodhganga.inflibnet.ac.in/bitstream/10603/27325/13/13_chapter8.pdf · CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE

135

CHAPTER 8

SWITCHING BASED ADAPTIVE MEAN FILTER

TO REMOVE MIXED NOISE WITH

EDGE PRESERVATION

8.1 INTRODUCTION

Noise cancellation is an important step in image processing and

many algorithms have been proposed to solve this problem. The algorithms

used for noise cancellation mainly depend on the types of noise in images. For

example, in image acquisition step, the photoelectric sensor introduces the

white Gaussian noise due to the thermal motion of electrons. With the

unstable network transfer, impulse noise is added into the image.

In many applications, these two types of noise are present in the

image together named as mixed noise. Mixed noise could occur when sending

an already corrupted image over a noisy communication channel. Neither

mean filter nor median filter alone can efficiently reduce the mixed noise.

There are many mixed noise removal methods presented in recent literatures.

A hybrid filter (Peng and Lucke 1995) that consists of a nonlinear filter and a

weighted linear filter is proposed to reduce the mixed noise. A combination of

mean and median filter (Khriji and Gabbouj 1998, and Rabie 2004) has been

reported to suppress the mixed noise. A histogram based fuzzy filter

(Wang et al 2002) has been proposed to remove the heavy tailed and Gaussian

noise. Three filters (Chio and Krishnapuram 1997) were introduced for

removing impulse noise, smoothing out non-impulse noise and enhancing

Page 2: CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO …shodhganga.inflibnet.ac.in/bitstream/10603/27325/13/13_chapter8.pdf · CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE

136

edges. A novel fuzzy filter (Taguchi 1998) has been reported in the literature

to suppress mixed Gaussian and impulse noise. A Signal Dependent Rank

Ordered Mean (SD-ROM) filter (Abreu et al 1996) has been proposed to

remove low density mixed noise effectively. Srinivasan and Ebenezer (2007)

has proposed two new filters to remove Gaussian and mixed noise. These

filters suppress mixed noise of lower densities.

A hybrid filter, introduced by, (Rui Li and Yu-Jin Zhang 2003)

which combines the advantage of the improved adaptive Wiener filter and

bilinear interpolation filter can efficiently reduce both white Gaussian noise

and impulse noise has been introduced. A Trilateral Filter (Garnett 2005) that

is based on a Rank Ordered Absolute Difference (ROAD) statistic to detect

impulse noise pixels in an image is reported. Instead of applying the “detect

and replace” methodology of most impulse noise removal techniques, the

trilateral filter integrates such a statistic into a filter designed to remove

Gaussian noise. The behavior of the filter can be adaptively changed to

remove impulses while retaining the ability to smooth Gaussian noise.

Additionally, the filter can be easily adopted to remove mixed noise.

Although these existing filters have impressive quantitative results, when

applied to images with mixed noise, it often produces visually disappointing

output similar to that of other median-based filters. In addition, the circuit

complexity and computation time are high for Trilateral Filter.

In this chapter, a new simple two stage algorithm called as

switching based adaptive mean filter (SBAMF), which can effectively remove

Gaussian, impulse and mix of Gaussian and impulse noise in images is

proposed. To begin with, mixed noise model is defined. Next, the proposed

algorithm is described. The performance of the proposed filter is tested and

compared with existing filters for different noise corrupted test images. The

visual and quantitative results show that the proposed filter is particularly

Page 3: CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO …shodhganga.inflibnet.ac.in/bitstream/10603/27325/13/13_chapter8.pdf · CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE

137

effective in suppressing high density mixed Gaussian and impulse noise. In

addition, the proposed filter is shown to exhibit good edge and detail

preserving characteristics.

8.2 MIXED NOISE MODEL

The images contaminated by Gaussian noise can be modeled by the

following equations:

GG(i,j) = O(i,j) + N (i,j) (8.1)

where O(i,j) and G(i,j) are the gray scale value of original image and

Gaussian noise corrupted image located at the pixel (i,j), NG(i,j) is the

Gaussian noise positioned at the pixel (i,j).The corresponding pixel of the

mixed noise image will be X(i,j), then the probability density function of Xi,j

is ,

p for x=02(x) 1 p for x=Gi,j

p for x=2552

(8.2)

8.3 SWITCHING BASED ADAPTIVE MEAN FILTER (SBAMF)

The noise variance is calculated using the flat region of the noisy image.

A sliding window size of 3x3 is taken with only those pixels that are less than the

maximum value in the sliding window (i.e salt noise of value 255) and greater than

the minimum value in the sliding window (i.e, pepper noise of value 0). Pixels are

taken along the boundary of the current window (Refer Figure 8.1) and their mean

values are calculated.

Page 4: CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO …shodhganga.inflibnet.ac.in/bitstream/10603/27325/13/13_chapter8.pdf · CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE

138

8.4 RESULTS AND DISCUSSIONS

In this section, noise removal capability of the proposed SBAM

filter is tested separately for Gaussian noise, impulse noise and mix of

Gaussian and impulse noise. The results are compared with existing methods

such as standard median filter, and alpha trimmed mean filter. The SBAM

filter is tested using different test images such as Elaine, Pepper, Lena and

Parrot (colour) of size 512x512, 8 bits/pixel.

Figures 8.3 and 8.4 show the restoration results of various filters for

the Elaine image and Pepper image corrupted by Gaussian noises of standard

deviation 20 and 40 respectively. Figure 8.5 show that the performance of

various filters for the Lena image corrupted by Salt and Pepper noise of

density 70%.

Figures 8.6, 8.7 and 8.8 shows the filtered outputs of the proposed

algorithm for Elaine, Pepper and Parrot (colour) images corrupted by mixed

Gaussian and impulse noise .The restoration results of SMF, Alpha trimmed

mean filter, Trilateral filter and the proposed filter for the pepper image

corrupted by Gaussian noise of Standard deviation 20 and salt and pepper

noise of density 40% is shown in Figure 8.9.

The visual quality clearly shows that the proposed filter

outperforms the other methods in terms of noise removal and edge

preservation. Figures 8.2 (e) and 8.3 (e) show that the proposed method has

better noise suppression than the existing methods. Comparing Figures 8.5 (e)

and 8.5 (f) the streaks present in the Srini-Ebenezer method is not present in

the proposed method. Figure 8.9 (f) shows that the SBAMF has better noise

suppression and detail preservation compared to the recently proposed

Trilateral filter and well known Alpha trimmed mean filter outputs as shown

in Figures 8.9 (e) and 8.9(d) respectively.

Page 5: CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO …shodhganga.inflibnet.ac.in/bitstream/10603/27325/13/13_chapter8.pdf · CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE

139

A quantitative comparison is performed between the conventional

and the proposed filter on the basis of three objective quality measures,

namely, PSNR, MAE and MSE as defined in equations (2.3), (2.4) and (2.5)

respectively. Tables 8.1, 8.2, and 8.3 show the comparison of PSNR, MAE

and MSE of various filters for the Pepper image corrupted by Gaussian noise

of different standard deviations for an impulse noise density of 40%.

Tables 8.4, 8.5, and 8.6 show the comparison of PSNR, MAE and MSE of

various filters for the Pepper image corrupted by impulse noise densities at

Gaussian noise of standard deviation 20. Figure 8.10 shows the comparison

graph of PSNR of various filters for the Pepper image at different Gaussian

noise standard deviations with a salt and pepper noise density of 40%.

Figure 8.11 shows the comparison graph of PSNR of various filters for

Pepper image at different salt and pepper noise densities with a Gaussian

noise of standard deviation 20. The simulations are performed in a PC (2.4

GHz CPU and 256 MB of RAM) equipped with MATLAB 7.1.

(a) (b) (c)

Page 6: CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO …shodhganga.inflibnet.ac.in/bitstream/10603/27325/13/13_chapter8.pdf · CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE

140

(d) (e)

Figure 8.3 (a) Original Elaine image (b) Noisy image (SD = 20).

Restoration results of (c) Alpha-Trimmed Mean Filter (d)

K-means Filter (e) Proposed method – SBAMF

(a) (b) (c)

(d) (e)

Page 7: CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO …shodhganga.inflibnet.ac.in/bitstream/10603/27325/13/13_chapter8.pdf · CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE

141

Figure 8.4 (a) Original Pepper Image (b) Noisy Image (SD = 40).

Restoration Results of (c) Alpha-Trimmed Mean Filter (d)

K-Means Filter (e) Proposed Method – SBAMF

Page 8: CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO …shodhganga.inflibnet.ac.in/bitstream/10603/27325/13/13_chapter8.pdf · CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE

142

(a) (b) (c)

(d) (e) (f)

Figure 8.5 (a) Original Lena Image (b) Noisy Image (SP = 70%).

Restoration Results of (c) PSMF (d) AMF (e) Srini-Ebenezer

Method (f) Proposed Method – SBAMF

Page 9: CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO …shodhganga.inflibnet.ac.in/bitstream/10603/27325/13/13_chapter8.pdf · CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE

143

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Figure 8.6 (a,d,g)Original Elaine Image (b) Noisy Image (SD=20,

SP=10%). (e) Noisy Image (SD=20, SP=30%) (h) Noisy

Image (SD=20, SP=50%) (c,f,i) Restoration Results of

Proposed Method – SBAMF

Page 10: CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO …shodhganga.inflibnet.ac.in/bitstream/10603/27325/13/13_chapter8.pdf · CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE

144

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Figure 8.7 (a,d,g)Original Pepper Image (b) Noisy image (SD=10,

SP=30%). (e) Noisy Image (SD=20, SP=30%) (h) Noisy

Image (SD=30, SP=30%) (c,f,i) Restoration Results of

Proposed Method – SBAMF

Page 11: CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO …shodhganga.inflibnet.ac.in/bitstream/10603/27325/13/13_chapter8.pdf · CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE

145

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Figure 8.8 (a,d,g)Original Parrot Image (b) Noisy image (SD=20,

SP=10%). (e) Noisy Image (SD=20, SP=30%) (h) Noisy

Image (SD=20, SP=50%) (c,f,i) Restoration Results of

Proposed Method – SBAMF

Page 12: CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO …shodhganga.inflibnet.ac.in/bitstream/10603/27325/13/13_chapter8.pdf · CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE

146

(a) (b) (c)

(d) (e) (f)

Figure 8.9 (a) Original Pepper Image (b) Noisy Image (SD=20,

SP= 40%). Restoration Results of (c) SMF (d) Alpha

Trimmed Mean Filter (e) Trilateral Filter (f) Proposed

Method – SBAMF

Table 8.1 PSNR of Various Filters for Pepper Image at Different Noise

Standard Deviations for Salt and Pepper Noise Density of

40% (in dB)

SD SMF Alpha Trimmed Trilateral Filter SBAMF 10 18.44 19.35 20.63 30.16 15 18.09 18.34 19.52 29.86 20 17.75 17.93 18.65 29.11 25 17.26 16.25 17.45 27.01 30 16.94 15.92 16.71 26.89 35 15.42 14.64 15.88 26.01

Page 13: CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO …shodhganga.inflibnet.ac.in/bitstream/10603/27325/13/13_chapter8.pdf · CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE

147

Table 8.2 MAE of Various Filters for Pepper Image at Different Noise

Standard Deviations for Salt and Pepper Noise density of

40%

SD SMF Alpha Trimmed Trilateral Filter SBAMF 10 12.336 21.361 6.45 4.91 15 14.81 21.422 8.74 5.57 20 17.34 21.583 10.79 6.17 25 19.933 21.43 13.13 8.26 30 22.16 21.567 16.59 8.35 35 24.752 21.736 18.23 9.38

Table 8.3 MSE of Various Filters for Pepper Image at Different Noise

Standard Deviations for Salt and Pepper Noise Density of

40%

SD SMF Alpha Trimmed Trilateral filter SBAMF 10 929.62 753.93 155.97 53.055 15 1007.5 900.66 254.02 67.016 20 1090.4 958.59 410.73 79.701 25 1220.8 1077.9 512.51 129.2 30 1315.4 1107.6 629.23 133.03 35 1479.8 1277 712.34 163.1

Table 8.4 PSNR of Various Filters for Pepper Image at Different

Noise Densities for Noise Standard Deviation of 20

Noise Density SMF Alpha Trimmed Trilateral filter SBAMF 10 26.8 25.01 27.74 29.55 20 24.63 22.83 26.31 29.31 30 21.18 20.97 22.85 29.12 40 17.81 19.31 21.79 28.96 50 14.64 17.97 19.35 27.82

Page 14: CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO …shodhganga.inflibnet.ac.in/bitstream/10603/27325/13/13_chapter8.pdf · CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE

148

Table 8.5 MAE of Various Filters for Pepper Image at Different Noise

Densities for a Noise Standard Deviation of 20

Noise Density SMF Alpha Trimmed Trilateral Filter SBAMF 10 8.5404 10.109 7.28 6.1993 20 9.9882 13.772 1.4852 6.3442 30 2.6688 17.451 3.89 6.4925 40 7.2598 21.583 10.95 6.5321 50 25.205 25.523 26.47 6.1729

Table 8.6 MSE of Various Filters for Pepper Image at Different Noise

Densities for a Noise Standard Deviation of 20

Noise Density SMF Alpha Trimmed Trilateral Filter SBAMF 10 135.55 204.86 109.17 19.679 20 223.78 338.78 151.82 25.109 30 494.86 519.19 337.15 26.024 40 1079.4 761.59 1053.3 25.403 50 2231.4 1036.8 2.8973 29.212

Standard Deviation vs PSNR

05

101520253035

10 15 20 25 30 35Noise Standard Deviation

Peak

Sig

nal t

o N

oise

R

atio

SMF

AlphaTrimmed

Trilateralfilter

SBAMF

Figure 8.10 PSNR Plot of Various Filters for Pepper Image at Different

Gaussian Noise Standard Deviations with Salt and Pepper

Noise Density of 40%

Peak

sign

al to

noi

se ra

tio

(dB

)

Page 15: CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO …shodhganga.inflibnet.ac.in/bitstream/10603/27325/13/13_chapter8.pdf · CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE

149

Noise Density vs PSNR

0

5

10

15

20

25

30

10 20 30 40 50Noise Density

Peak

Sig

nal t

o N

oise

R

atio

SMF

AlphaTrimmed

Trilateralfilter

SBAMF

Figure 8.11 PSNR Plot of Various Filters for Pepper Image at Different

(SP) Noise Densities with a Gaussian Noise of SD=20

Figure 8.12 shows the original Pepper image, restored image and

error image corrupted by a Gaussian noise standard deviation of 20 and salt

and pepper noise of 40% to emphasize the noise removal capability of the

proposed SBAM filter.

Peak

sign

al to

noi

se ra

tio

(dB

)

Page 16: CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO …shodhganga.inflibnet.ac.in/bitstream/10603/27325/13/13_chapter8.pdf · CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE

150

(a)

(b)

(c)

Figure 8.12 (a) Original Pepper Image (b) Restored Image using the

proposed SBAM filter corrupted by SD = 20 and SP = 40%

(c) Error Image

Page 17: CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO …shodhganga.inflibnet.ac.in/bitstream/10603/27325/13/13_chapter8.pdf · CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE

151

8.4.1 Computational Complexity

Table 8.7 shows the computation time required to restore a Pepper

image corrupted at 60% random valued impulse noise. The computational

time is calculated for all seven filtering techniques in a PC (Pentium CPU 2.4

GHz and 256-MB RAM) equipped with MATLAB 7.1. Even though the

proposed SBAM filter takes slightly higher time to restore the original image,

it produces superior results in terms of subjective and objective measures.

Table 8.7 Comparison of Computation Time for Pepper image

Corrupted at SD = 20 and SP = 40%

Methods Time in seconds

SMF 3.3

Alpha-Trimmed Mean Filter 40.23

Trilateral Filter 60.68

SBAM Filter 171.23

Page 18: CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO …shodhganga.inflibnet.ac.in/bitstream/10603/27325/13/13_chapter8.pdf · CHAPTER 8 SWITCHING BASED ADAPTIVE MEAN FILTER TO REMOVE

152

8.5 SUMMARY

In this chapter, a new Switching Based Adaptive Mean filter

(SBAMF) is proposed to remove mixed Gaussian and impulse noises in

images, in a single filtering pass. The proposed SBAM filter has been tested

for different test images and the results have been compared with the existing

methods for Gaussian noise, impulse noise and mixed Gaussian and impulse

noise. The better performance of the proposed filter over the existing methods

is due to the computation of correct threshold, based on noise variance and

smoothing factor. The visual and quantitative results show the superior

performance of the proposed filter over the existing filters in terms of noise

removal and detail preservation.