adaptive median filtering

Upload: vivek2mb

Post on 14-Oct-2015




0 download

Embed Size (px)


Adaptive Median Filtering


  • 5/24/2018 Adaptive Median Filtering




    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.


    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


    . The neighborhood

    then moves successively over every piel in the image, repeating the process.


  • 5/24/2018 Adaptive Median Filtering


    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 imagesA(x)andB(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.

  • 5/24/2018 Adaptive Median Filtering


    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 meanof neighboring piel values, it replaces it with the medianof 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.

  • 5/24/2018 Adaptive Median Filtering


    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,

  • 5/24/2018 Adaptive Median Filtering


    Fi$)re , =riginal &mage


  • 5/24/2018 Adaptive Median Filtering


    Fi$)re - &mages and histograms resulting from adding ;aussian,

  • 5/24/2018 Adaptive Median Filtering


    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 lets 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


  • 5/24/2018 Adaptive Median Filtering


    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.

  • 5/24/2018 Adaptive Median Filtering


    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

    adustable, as well as the threshold for the comparison. A piel that is different from a maority 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.



  • 5/24/2018 Adaptive Median Filtering


    else increase the window si)e

    if window si)e I :ma, repeat level A

    else output y

    $evel J( J+ G y - min

    J2 G y - ma

    if J+ H 5 A!D J2 I 5, output y

    else output med

    E >planation

    $evel A( &F min I med I ma, then

    L med is not an impulse

    "+# go to level J to test if y is an impulse ...


    L med is an impulse

    "+# the si)e of the window is increased and

    "2# level A is repeated until ...

    "a# med is not an impulse and go to level J or

    "b# :ma reached( output is y

    $evel J( &F min I y I ma, then

    L y is not an impulse

    "+# output is y "distortion reduced#


    L either y G min or y G ma

    "2# output is med "standard median filter# L med is not an impulse "from level A#


  • 5/24/2018 Adaptive Median Filtering



    The standard median filter does not perform well when impulse noise isa. ;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 @.


  • 5/24/2018 Adaptive Median Filtering


    a# &mage corrupted by impulse noise b#

  • 5/24/2018 Adaptive Median Filtering



    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.


  • 5/24/2018 Adaptive Median Filtering



    +NRa"ae% C4 Go!5a%e5 a!# Richar# E4 Woo#sDigital Image Processing, 255+, pp.225 O 263.

    6+7 R4 Bo8%e a!# R4 Tho&asComputer Vision: A First Course, Jlac'well :cientific Publications, +K, pp.

    32 - 36.

    3NE4 Da.iesMachine Vision: heor!, Algorithms and Practicalities, Academic Press, +KK5, 0hap. 3.

    6NA4 Mario!An Introduction to Image Processing, 0hapman and all, +KK+, pp. 2C6.

    4ND4 Ver!o!Machine Vision, Prentice-all, +KK+, 0hap. 6.

    @N94 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, Jeiing, +K.


  • 5/24/2018 Adaptive Median Filtering


    CN04Moro: T4Waa!abe: A4Ta$)chi a!# N4 0a&a#a: "%n the adapti&e algorithm and its con&ergence

    rate impro&ement o$ 'Dlattice $ilter", +K &>>> &nternational :ymposium on 0ircuits and :ystems,

    Proceeding vol. + of 3, pp. 635-636.

    NR4Me8%a!i: S4Se5e!: A4 Er;5;!: Y4 Ise"a!op)%os: "M# and *radient Based Adaptation Algorithms

    $or the +ightParameter oDimensional attice Filter", Proceedings of the >uropean 0onference on

    0ircuit Theory and Design, pp.C6+-C66, +KK4.