Sunteți pe pagina 1din 15

ADAPTIVE MEDIAN FILTERING

ABSTRACT
The application of median filter has been investigated. As an advanced method compared with standard
median filtering, the Adaptive Median Filter performs spatial processing to preserve detail and smooth non-
impulsive noise. A prime benefit to this adaptive approach to median filtering is that repeated applications of
this Adaptive Median Filter do not erode away edges or other small structure in the image.
KEY WOEDS
Digital image processing, Piel, !eighborhood, Median filter, Mean filter "average filter#, $inear % non-
linear filter, &mage smoothing, &mage enhancement, &mpulse noise "salt % pepper noise#
The basic operaio! o" #i$ia% i&a$e processi!$
To understand what adaptive median filtering is all about, one first needs to understand what a median filter
is and what it does. &n many different 'inds of digital image processing, the basic operation is as follows( at
each piel in a digital image we place a neighborhood
around that point, analy)e the values of all the piels in the neighborhood according to some algorithm,
and then replace the original piel*s value with one based on the analysis performed on the piels in the
neighborhood
. The neighborhood
then moves successively over every piel in the image, repeating the process.
+
Wha a &e#ia! "i%er is a!# 'ha i #oes(
Median filtering follows this basic prescription. The median filter is normally used to reduce noise in an
image, somewhat li'e the mean filter. ,owever, it often does a better -ob than the mean filter of preserving
useful detail in the image. This class of filter belongs to the class of edge preserving smoothing filters which
are non-linear filters. This means that for two images A(x) and B(x)(
These filters smooths the data while 'eeping the small and sharp details. The median is -ust the middle value
of all the values of the piels in the neighborhood. !ote that this is not the same as the average "or mean#.
instead, the median has half the values in the neighborhood larger and half smaller. The median is a stronger
/central indicator/ than the average. &n particular, the median is hardly affected by a small number of
discrepant values among the piels in the neighborhood. 0onse1uently, median filtering is very effective at
removing various 'inds of noise. Figure + illustrates an eample of median filtering.
2
Fi$)re *
$i'e the mean filter, the median filter considers each piel in the image in turn and loo's at its nearby
neighbors to decide whether or not it is representative of its surroundings. &nstead of simply replacing the
piel value with the mean of neighboring piel values, it replaces it with the median of those values. The
median is calculated by first sorting all the piel values from the surrounding neighborhood into numerical
order and then replacing the piel being considered with the middle piel value. "&f the neighborhood under
consideration contains an even number of piels, the average of the two middle piel values is used.# Figure
2 illustrates an eample calculation.
3
Fi$)re + 0alculating the median value of a piel neighborhood. As can be seen, the central piel value of
+45 is rather unrepresentative of the surrounding piels and is replaced with the median value( +26. A 373
s1uare neighborhood is used here --- larger neighborhoods will produce more severe smoothing.
Wha is !oise(
!oise is any undesirable signal. !oise is everywhere and thus we have to learn to live with it. !oise gets
introduced into the data via any electrical system used for storage, transmission, and8or processing. &n
addition, nature will always plays a /noisy/ tric' or two with the data under observation. 9hen encountering
an image corrupted with noise you will want to improve its appearance for a specific application. The
techni1ues applied are application-oriented. Also, the different procedures are related to the types of noise
introduced to the image. :ome eamples of noise are( ;aussian or 9hite, <ayleigh, :hot or &mpulse,
periodic, sinusoidal or coherent, uncorrelated, and granular.
Noise Mo#e%s
!oise can be characteri)ed by its(
Probability density function "pdf#( ;aussian, uniform, Poisson, etc.
:patial properties( correlation
Fre1uency properties( white noise vs pin' noise
6
Fi$)re , =riginal &mage
4
Fi$)re - &mages and histograms resulting from adding ;aussian, <ayleigh and ;amma noise to the original
image.
Fi$)re - "continued# &mages and histograms resulting from adding >ponential, ?niform and :alt % Pepper
noise to the original image.
@
Co&pariso! be'ee! he &e#ia! "i%er a!# he a.era$e "i%er
:ometimes we are confused by median filter and average filter, thus letAs do some comparison between
them. The median filter is a non-linear tool, while the average filter is a linear one.
&n smooth, uniform areas of the image, the median and the average will differ by very little. The median
filter removes noise, while the average filter -ust spreads it around evenly. The performance of median filter
is particularly better for removing impulse noise than average filter.
As Figure 4 shown below are the original image and the same image after it has been corrupted by impulse
noise at +5B. This means that +5B of its piels were replaced by full white piels. Also shown are the
median filtering results using 33 and 44 windows. three "3# iterations of 33 median filter applied to the
noisy image. and finally for comparison, the result when applying a 44 mean filter to the noisy image.
a#=riginal image. b#Added &mpulse !oisy at +5B
C
a#33 Median Filtered. b#44 Median Filtered
0omparison of the non-linear Median filter and the linear Mean filter.
a#33 Median Filtered applied 3 times. b#44 Average Filter
Fi$)re /
The #isa#.a!a$e o" he &e#ia! "i%er
Although median filter is a useful non-linear image smoothing and enhancement techni1ue. &t also has some
disadvantages. The median filter removes both the noise and the fine detail since it can*t tell the difference
between the two. Anything relatively small in si)e compared to the si)e of the neighborhood will have
minimal affect on the value of the median, and will be filtered out. &n other words, the median filter can*t
distinguish fine detail from noise.
D
A#api.e Me#ia! Fi%eri!$
Therefore the adaptive median filtering has been applied widely as an advanced method compared with
standard median filtering. The Adaptive Median Filter performs spatial processing to determine which piels
in an image have been affected by impulse noise. The Adaptive Median Filter classifies piels as noise by
comparing each piel in the image to its surrounding neighbor piels. The si)e of the neighborhood is
ad-ustable, as well as the threshold for the comparison. A piel that is different from a ma-ority of its
neighbors, as well as being not structurally aligned with those piels to which it is similar, is labeled as
impulse noise. These noise piels are then replaced by the median piel value of the piels in the
neighborhood that have passed the noise labeling test.
P)rpose
+#. <emove impulse noise
2#. :moothing of other noise
3#. <educe distortion, li'e ecessive thinning or thic'ening of ob-ect boundaries
0o' i 'or1s(
E Adaptive median filter changes si)e of :y "the si)e of the neighborhood# during operation.
E !otation
Fmin G minimum gray level value in :y
Fma G maimum gray level value in :y
Fmed G median of gray levels in :y
Fy G gray level at coordinates ", y#
:ma G maimum allowed si)e of :y
E Algorithm
$evel A( A+ G Fmed - Fmin
A2 G Fmed - Fma
if A+ H 5 A!D A2 I 5, go to level J
K
else increase the window si)e
if window si)e I :ma, repeat level A
else output Fy
$evel J( J+ G Fy - Fmin
J2 G Fy - Fma
if J+ H 5 A!D J2 I 5, output Fy
else output Fmed
E >planation
$evel A( &F Fmin I Fmed I Fma, then
L Fmed is not an impulse
"+# go to level J to test if Fy is an impulse ...
>$:>
L Fmed is an impulse
"+# the si)e of the window is increased and
"2# level A is repeated until ...
"a# Fmed is not an impulse and go to level J or
"b# :ma reached( output is Fy
$evel J( &F Fmin I Fy I Fma, then
L Fy is not an impulse
"+# output is Fy "distortion reduced#
>$:>
L either Fy G Fmin or Fy G Fma
"2# output is Fmed "standard median filter#
L Fmed is not an impulse "from level A#
+5
A#.a!a$es
The standard median filter does not perform well when impulse noise is
a. ;reater than 5.2, while the adaptive median filter can better handle these noises.
b. The adaptive median filter preserves detail and smooth non-impulsive noise, while the standard
median filter does not.
:ee eample form a# to d#
in figure @.
++
a# &mage corrupted by impulse noise b# <esult of arithmetic mean filtering.
with a probability of 5.+.
c# <esult of adaptive median filtering. d# <esult of standard median filtering
Fi$)re 2
+2
Co!c%)sio!3
The median filter performs well as long as the spatial density of the impulse noise is not large. ,owever the
adaptive median filtering can handle impulse noise with probabilities even larger than these. An additional
benefit of the adaptive median filter is that it see's to preserve detail while smoothing nonimpulse noise.
0onsidering the high level of noise, the adaptive algorithm performed 1uite well. The choice of maimum
allowed window si)e depends on the application, but a reasonable starting value can be estimated by
eperimenting with various si)es of the standard median filter first. This will establish a visual baseline
regarding epectations on the performance of the adaptive algorithm.
+3
Re"ere!ces
M+N Ra"ae% C4 Go!5a%e5 a!# Richar# E4 Woo#s Digital Image Processing, 255+, pp.225 O 263.
6+7 R4 Bo8%e a!# R4 Tho&as Computer Vision: A First Course, Jlac'well :cientific Publications, +KDD, pp.
32 - 36.
M3N E4 Da.ies Machine Vision: heor!, Algorithms and Practicalities, Academic Press, +KK5, 0hap. 3.
M6N A4 Mario! An Introduction to Image Processing, 0hapman and ,all, +KK+, pp. 2C6.
M4N D4 Ver!o! Machine Vision, Prentice-,all, +KK+, 0hap. 6.
M@N 94 Che!: A4 K4 9ai!: "A #tructural Approach to Identi$! De$ects on extural Images", Proceedings of the
&>>> &nternational 0onference on :ystems, Man, and 0ybernetics, pp. 2K-32, Jei-ing, +KDD.
+6
MCN 04Moro: T4Waa!abe: A4Ta$)chi a!# N4 0a&a#a: "%n the adapti&e algorithm and its con&ergence
rate impro&ement o$ '(Dlattice $ilter", +KDD &>>> &nternational :ymposium on 0ircuits and :ystems,
Proceeding vol. + of 3, pp. 635-636.
MDN R4Me8%a!i: S4Se5e!: A4 Er;5;!: Y4 Ise"a!op)%os: ")M# and *radient Based Adaptation Algorithms
$or the +ight(Parameter ,o(Dimensional )attice Filter", Proceedings of the >uropean 0onference on
0ircuit Theory and Design, pp.C6+-C66, +KK4.
+4

S-ar putea să vă placă și