05-1 - Image Restoration and Reconstruction

Embed Size (px)

Citation preview

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    1/25

    4/28/

    Image restoration and

    preliminaries, basic

    techniques, and additive

    Spring2008 ELEN4304/5365DIP 1

    noise onlybyGlebV.Tcheslavski:[email protected]

    http://ee.lamar.edu/gleb/dip/index.htm

    Preliminaries

    Image Restoration includes processes that

    attempt to remove degradations and restore an

    image to a previous state.

    Restoration techniques are oriented towardmodeling the degradation and applying theinverse process to recover the original image.

    Spring2008 ELEN4304/5365DIP 2

    s s ngu s e rom en ancemenin that degradation can be considered an externalinfluence that is separate from the image signal.

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    2/25

    4/28/

    Preliminaries

    Restoration usually involves formulating acriterion of goodness that will give an optimalestimate of the desired result.

    Enhancement, on the other hand, usuallymanipulates with subjective criteria.

    Spring2008 ELEN4304/5365DIP 3

    ,removing the image blur when applying a

    deblurring function is a restoration.

    Model for imagedegradation/restoration process

    We will assume that a de radation function exists, which, to ether

    Spring2008 ELEN4304/5365DIP 4

    with additive noise, operates on the input imagef(x,y) to produce a

    degraded image g(x,y).

    The objective of restoration is to obtain an estimate for the original

    image from its degraded version g(x,y) while having some knowledge

    about the degradation functionHand the noise (x,y).

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    3/25

    4/28/

    Model for image

    degradation/restoration processIf degradationHis a linear, position-invariant process, the degraded

    image in the spatial domain is

    ( , ) ( , ) ( , ) ( , )g x y h x y f x y x y= +convolution

    Therefore, in the frequency domain it is

    ( , ) ( , ) ( , ) ( , )G u v H u v F u v N u v= +

    Spring2008 ELEN4304/5365DIP 5

    We will assume first thatHis an identity operator and

    all degradation is due to additive noise.

    Noise modelsMost of the noise degradation comes to digital images during their

    acquisition and/or transmission. A wide variety of factors may affect

    . ,

    levels and a sensor temperature of a CCD camera are two major

    factors determining the amount of noise in the resulting image.

    We assume (unless otherwise stated) that noise is independent of

    spatial coordinates and that it is uncorrelated with respect to the

    image itself (no correlation between pixel values and values of

    Spring2008 ELEN4304/5365DIP 6

    noise components).

    The spatial noise descriptor is the statistical behavior of the intensity

    values in the noise component. Noise intensity can be considered as

    a random variable characterized by a certain pdf.

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    4/25

    4/28/

    Noise pdfsp(z)

    1

    2

    p(z)

    0.607

    2

    Spring2008 ELEN4304/5365DIP 7

    a

    Noise pdfs1. Gaussian (normal) noise is very attractive from a mathematical

    point of view since its DFT is another Gaussian process.

    . .

    ( )2

    221

    ( )2

    z z

    p z e

    =

    Herez represents intensity,is the mean

    p(z)

    1

    2

    Spring2008 ELEN4304/5365DIP 8

    ,deviation. 2 is the variance ofz.

    Electronic circuit noise, sensor noise due to

    low illumination or high temperature.

    0.607

    2

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    5/25

    4/28/

    Noise pdfs

    2. Rayleigh noise is specified as( )

    2

    2z a

    ( )

    0

    z a e z ap z b

    z a

    = 0 and b is a positive integer. The mean

    and variance are given by

    z b a=

    Spring2008 ELEN4304/5365DIP 10

    2 2b a =

    When the denominator is the gamma function, the pdf describes

    the gamma distribution.

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    6/25

    4/28/

    Noise pdfs

    4. Exponential noise is specified as0azae z

    =

    p(z)

    a

    0 0z 0. The mean and variance are given by

    1z a=

    Spring2008 ELEN4304/5365DIP 11

    1 a =

    Exponential pdf is a special case of Erlang pdf with b =1.Used in laser imaging.

    Noise pdfs5. Uniform noise is specified as

    1 ( )

    0

    p z b a

    otherwise

    =

    The mean and variance are given by

    a bz

    +=

    Spring2008 ELEN4304/5365DIP 12

    ( )2

    2

    12

    b a

    =

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    7/25

    4/28/

    Noise pdfs

    6. Impulse (salt-and-pepper) noise (bipolar) is specified as

    ( )

    0

    a

    b

    z a

    p z P z b

    otherwise

    =

    = =

    Ifb>a, intensity b will appear as a light dot on the image and a

    Spring2008 ELEN4304/5365DIP 13

    . a b ,

    unipolar. Frequently, a and b aresaturatedvalues, resulting in

    positive impulses being white and negative impulses being black.

    This noise shows up when quick transitions such as faulty

    switching take place.

    Test pattern

    Spring2008 ELEN4304/5365DIP 14

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    8/25

    4/28/

    Additive Noise patterns

    Spring2008 ELEN4304/5365DIP 15

    Additive Noise patterns

    It is very

    hard to

    v sua y

    discriminate

    between first

    five noise

    corruptions.

    Spring2008 ELEN4304/5365DIP 16

    s ogramsare quite

    handy

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    9/25

    4/28/

    Periodic noise

    This noise typically cams fromelectrical or electromechanical

    acquisition. We dont consider

    any other spatially dependent

    noise.

    If the noise is strong enough, it

    can be seen in the fre uenc

    Spring2008 ELEN4304/5365DIP 17

    domain.

    Estimation of noise parameters

    The parameters of periodic noise are usually estimated in the

    fre uenc domain.

    The parameters of noise pdf can be partially known from the sensor

    specifications. However, they usually need to be estimated for a

    specific imaging system. If such a system is available, the easiest way

    to estimate the noise is to capture a set of images of a flat

    environments (for instance, images of a solid gray board illuminated

    Spring2008 ELEN4304/5365DIP 18

    uniformly). The resulting images are usually good indicators of

    system noise.

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    10/25

    4/28/

    Estimation of noise parameters

    If only the images are available, frequently it is possible to estimatethe parameters of noise pdf from small patches of reasonably constant

    .

    Spring2008 ELEN4304/5365DIP 19

    Gaussian Rayleigh Uniform

    Estimation of noise parametersThe simplest use of the data from the image strips is to calculate the

    mean and variance of intensity levels:

    ( )

    1

    0

    12

    0

    ( )

    ( )

    L

    i s i

    i

    L

    i s i

    i

    z z p z

    z z p z

    =

    =

    =

    =

    If the sha e of df is Gaussian, the mean and variance com letel

    Spring2008 ELEN4304/5365DIP 20

    specify it. Otherwise, these estimates are needed to derive a and b.

    For impulse noise, we need to estimate actual probabilities Pa and Pbfrom the histogram.

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    11/25

    4/28/

    Restoration in the presence of

    noise only Spatial filtering

    When the only degradation in the image is noise:

    ( , ) ( , ) ( , )

    ( , ) ( , ) ( , )

    g x y f x y x y

    G u v F u v N u v

    = +

    = +

    the noise terms are unknown, so, subtracting them from g(x,y) or

    G(u,v) is not a realistic option. Therefore, spatial filtering is a good

    Spring2008 ELEN4304/5365DIP 21

    .

    We already discussed spatial filters before; here we discuss noise-

    rejection capabilities of different spatial filters.

    Restoration in the presence ofnoise only Spatial filtering1. Mean filters

    xy

    a rectangular neighborhood of size m x n, centered at the point (x,y).

    The arithmetic mean filter computed the average value of the

    corrupted image g(x,y) in the area defined by Sxy. The output is an

    arithmetic mean:

    1

    x s t=

    Spring2008 ELEN4304/5365DIP 22

    ( ), xys t Smn

    Such a filter smoothes local variations in an image; therefore, noise is

    reduced as a result of blurring.

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    12/25

    4/28/

    Restoration in the presence of

    noise only Spatial filteringb) Geometric mean filter: 1

    mn

    ( ),

    , ,xys t S

    x y g s t

    =

    Geometric mean filter achieves smoothing comparable to the

    arithmetic mean filter but it preserves more details.

    c) Harmonic mean filter:

    Spring2008 ELEN4304/5365DIP 23

    ( ),

    ( , )1

    ( , )xys t S

    f x y

    g s t

    =

    Harmonic mean filter works well for salt noise and other types of

    noise (such as Gaussian) but fails for pepper noise.

    Restoration in the presence ofnoise only Spatial filteringd) Contraharmonic mean filter:

    1Q+

    ( )

    ( )

    ,

    ,

    ,

    ( , )( , )

    xy

    xy

    s t S

    Q

    s t S

    f x yg s t

    =

    Here Q is the order of the filter. This filter is well suited for reducing

    Spring2008 ELEN4304/5365DIP 24

    t e e ects o sa t-pepper no se. or pos t ve va ues o , t e m nates

    paper noise; for negative values ofQ, it eliminates salt noise. This

    filter cannot reduce both simultaneously.

    Notice that contraharmonic filter reduces to the arithmetic mean filter

    when Q = 0 and to the harmonic mean filter ifQ = -1.

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    13/25

    4/28/

    Restoration in the presence of

    noise only Spatial filtering

    Ori inalImagecorru ted

    image

    Result of

    byadditiveGaussiannoise

    Result of

    Spring2008 ELEN4304/5365DIP 25

    filteringwith a 3x3

    arithmeticmeanfilter

    filteringwith a 3x3

    geometricmean filter

    Restoration in the presence ofnoise only Spatial filtering

    Imagecorru ted

    Imagecorru ted

    by saltnoise witha 0.1probability

    by peppernoise witha 0.1probability

    Result of Result of

    Spring2008 ELEN4304/5365DIP 26

    filtering

    with a 3x3contra-harmonicfilter Q=1.5

    filtering

    with a 3x3contra-harmonicfilter Q=-1.5

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    14/25

    4/28/

    Restoration in the presence of

    noise only Spatial filteringSelecting an incorrect sign in contraharmonic filtering may lead tounpleasant results...

    Spring2008 ELEN4304/5365DIP 27

    Pepper noise: result with Q = -1.5

    instead of 1.5

    Salt noise: result with Q = 1.5

    instead of -1.5

    Restoration in the presence ofnoise only Spatial filtering2. Order-statistic filters

    They are filters, whose response is based on ordering (ranking) pixels

    a) Median filter: replaces the pixel value by the median of the

    intensity levels in the neighborhood of that pixel:

    ( ){ }

    ,

    ( , ) ( , )xys t S

    f x y median g s t

    =

    Spring2008 ELEN4304/5365DIP 28

    Median filters provide excellent results for certain types of noise with

    considerably less blurring than linear smoothing filters of the same

    size. These filters are very effective against both bipolar and unipolar

    noise contaminations (ifPa < 0.2 and Pb < 0.2). The same filter can be

    applied more than once to yield better results.

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    15/25

    4/28/

    Restoration in the presence of

    noise only Spatial filteringImagecorrupted

    Result of asingle-pass

    y sa -and-peppernoise with

    Pa= Pb=

    0.1

    applicationof a 3x3medianfilter

    Result of aResult of a

    Spring2008 ELEN4304/5365DIP 29

    triple-passapplication

    of a 3x3medianfilter

    ou e-pass

    applicationof a 3x3medianfilter

    Restoration in the presence ofnoise only Spatial filteringb) Max and Min filters:

    ( ),

    , max ,xys t S

    x y g s t

    =

    ( , ) min ( , )f x y g s t=

    This filter is useful for finding the brightest points in an image;

    therefore, its effective against pepper noise.

    Spring2008 ELEN4304/5365DIP 30

    , xys t S

    This filter is useful for finding the darkest points in an image;

    therefore, its effective against salt noise.

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    16/25

    4/28/

    Restoration in the presence of

    noise only Spatial filtering

    Imagecorru ted

    Imagecorru ted

    by saltnoise witha 0.1probability

    by peppernoise witha 0.1probability

    Spring2008 ELEN4304/5365DIP 31

    esu o

    filtering

    with a 3x3max filter

    esu o

    filtering

    with a 3x3min filter

    Restoration in the presence ofnoise only Spatial filtering

    c) Midpoint filter: computes the midpoint between the maximum and

    ( ){ }

    ( ){ }

    ,,

    1( , ) max ( , ) min ( , )2 xyxy s t Ss t S

    f x y g s t g s t

    = +

    This filter is a combination of order statistics and averaging and

    Spring2008 ELEN4304/5365DIP 32

    wor s est or auss an an un orm no se contam nat ons.

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    17/25

    4/28/

    Restoration in the presence of

    noise only Spatial filteringd) Alpha-trimmed mean filter: if we delete d/2 highest intensity

    values and d/2 lowest intensity values, denote the rest as gr(x,y); a

    dcan range from 0 to mn-1. When d= 0, this filter reduces to the

    filter that averages what is left is alpha-trimmed mean filter:

    ( ),

    1( , ) ( , )xy

    r

    s t S

    f x y g s tmn d

    =

    Spring2008 ELEN4304/5365DIP 33

    arithmetic mean filter, when d= mn-1, this filter reduces to a median

    filter. For other values ofd, the filter is useful against contaminations

    with noise of multiple types, such as a combination of salt-and-pepperand Gaussian noise.

    Imagecorrupted byadditiveuniform noise

    Imageadditionallycorrupted bysalt-and-pepper noise

    Filtered by a5x5 arithmeticmean filter

    Filtered by a5x5 geometicmean filter

    Spring2008 ELEN4304/5365DIP 34

    Filtered by a5x5 medianfilter

    Filtered by a5x5 alpha-trimmed meanfilter with d= 5

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    18/25

    4/28/

    Restoration in the presence of

    noise only Spatial filtering3. Adaptive filters

    characteristics of the image inside the filter region Sxy.

    a) Adaptive local noise reduction filter: since the mean gives a

    measure for average intensity in the region and variance characterizes

    contrast in that region, they both are reasonable parameters to base an

    adaptive filter.

    Spring2008 ELEN4304/5365DIP 35

    Considering a local region Sxy of a noisy version g(x,y) of the image

    f(x,y) with the overall noise variance

    2, local mean of pixels in the

    region mL and their local variance L2, the following rules are to be

    implemented:

    Restoration in the presence ofnoise only Spatial filtering1. If

    2 is zero, the filter returns the value ofg(x,y);

    2. If L2 > 2 (typical for edges that needs to be preserved) the filter

    returns the value close to g(x,y);

    3. If two variances are equal, the filter returns the arithmetic mean

    value for pixels in the region Sxy.

    Therefore, the adaptive filter is:

    2

    x s t s t m

    =

    Spring2008 ELEN4304/5365DIP 36

    2

    L

    The only parameter that needs to be known in advance is the overall

    noise variance

    2; all other parameters are estimates for the selected

    area.

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    19/25

    4/28/

    Restoration in the presence of

    noise only Spatial filteringImagecorrupted by

    Filtered by

    a 7x7Gaussiannoise withzero mean,

    2 = 1000

    arithmeticmean filter

    Filtered by

    Spring2008 ELEN4304/5365DIP 37

    Filtered bya 7x7

    geometricmean filter

    a xadaptive

    noisereductionfilter with

    2 = 1000

    Restoration in the presence ofnoise only Spatial filtering

    Adaptive filter achieves approximately the same performance in noise

    cancellation but adds much less blurring than the mean filters.

    Adaptive filtering typically yields considerably better results in

    overall performance at the price of filter complexity.

    In the example, the exact value of noise variance was used. If a

    Spring2008 ELEN4304/5365DIP 38

    var ance est mate use s too ow, no se correct on w e sma er

    than it should be. If the estimate is too high, the output image may

    lose dynamic range.

  • 8/2/2019 05-1 - Image Restoration and Reconstruction

    20/25

    4/28/

    Restoration in the presence of

    noise only Spatial filtering

    b) Adaptive median filter: can handle impulse noise with larger

    robabilities than traditional median filter. It o erates on a rectan ular

    region Sxy, whosesize is changing.

    Adaptive median filter has 3 goals: to remove impulse noise, to

    provide smoothing of other noise, and to reduce distortion (such as

    excessive thinning or thickening of object boundaries).

    Spring2008 ELEN4304/5365DIP 39

    Assuming thatzmin,zmax andzmedare the minimum, maximum, and

    median intensity values in Sxy,zxy is the intensity value at coordinates

    (x,y) and Smax is the maximum allowed size ofSxy, adaptive median-filtering algorithm works in two stages:

    Restoration in the presence ofnoise only Spatial filtering1 min 2 max

    1 20 0,

    med med A z z A z z

    IF A AND A go to stage B

    = ; =

    >