EEE F435 (2023-24-I)
Digital Image Processing
                       (Image Restoration-II)
BITS Pilani
K K Birla Goa Campus
                                                Ashish Chittora
Image Restoration
• Estimation of Degradation Model
• Inverse Filter
• Wiener Filter
• Geometric Mean Filter
• Constrained Least Squares Filter
Estimation of Degradation Model
Degradation model:
                 g ( x , y )  f ( x , y )  h ( x, y )   ( x , y )
                                    or
                 G(u, v)  F (u, v) H (u, v)  N (u, v)
  Purpose:
   To estimate h(x,y) or H(u,v)
  Why
    If we know exactly h(x,y), regardless of noise, we can do
    deconvolution to get f(x,y) back from g(x,y).
Estimation of Degradation Model
   The process of restoring an image by using a degradation function
   that has been estimated in some way sometimes is called ‘blind
   de-convolution’, due to the fact that true degradation function is
   seldom known completely.
   Methods:
   1. Estimation by Image Observation
   2. Estimation by Experiment
   3. Estimation by Modeling
1. Estimation by Image Observation
 • Estimate the function by gathering information from the
   image itself.
 • We look for areas of strong signal content. Using simple
   gray levels of the object and background, we can
   construct an unblurred image of the same size and
   characteristics as the observed subimage.
 • Assuming the effect of noise is negligible because of
   our choice of a strong signal area.
                                                         Gs (u , v)
                                         H s (u , v) 
                                                         Fˆs (u , v)
 • We then deduce the complete function H(u, v).
     Original image (unknown)                            Degraded image
f(x,y)                            f(x,y)*h(x,y)                       g(x,y)
                                                                      Observation
Estimated Transfer Function:                             DFT         Subimage
                                           Gs (u, v )                 g s ( x, y )
                             Gs (u , v)                                Restoration
   H (u , v)  H s (u , v)                                             process by
                             Fˆs (u , v)                               estimation
                                                         DFT          Reconstructed
This case is used when we                  Fˆs (u, v )
know only g(x,y) and cannot                                               Subimage
repeat the experiment!                                       fˆs ( x, y )
2. Estimation by Experiment
 • Used when we have the same equipment set up and can repeat
    the experiment.
 • Images similar to the degraded image can be acquired with
   various system settings until they are degraded as closely as
    possible to the image we wish to restore.
 • Then the idea is to obtain the impulse response of the
   degradation by imaging an impulse (small dot of light) using
   the same system settings.
 • An impulse is simulated by a bright dot of light, as bright as
   possible to reduce the effect of noise.
Input impulse image                           Response image from
                                                  the system
                              System
                               H( )
      A ( x, y )                                    g ( x, y )
  DFT                                                        DFT
DFT A ( x, y )  A                                G(u, v)
                                     G ( u, v )
                        H ( u, v ) 
                                         A
3. Estimation by Modeling
  • Used when we know physical mechanism underlying the
    image formation process that can be expressed mathematically.
  • In some cases, the model can even take into account
    environmental conditions that cause degradations.
    Example:
    A degradation model proposed by Hufnagel and Stanley[1964].
    Its based on the physical characteristics of atmospheric
    turbulence.
                                       k ( u 2  v 2 )5 / 6
                       H ( u, v )  e
    • Similar to the Gaussian LPF
    • ‘k’ is a constant that depends on the nature of the turbulence.
Original image    Severe turbulence
                  k = 0.0025
k = 0.001         k = 0.00025
Mild turbulence   Low turbulence
Example: Motion Blurring
Image f(x,y) undergoes a planar motion.
Assume that time varying components of motion in x- and y- directions
The blurred image is obtained by                    ( x0 (t ), y0 (t ))
                T
                                                                  Where T = exposure time.
    g ( x, y )   f ( x  x0 (t ), y  y0 (t ))dt
                 0
                                                                  g(x, y) is the blurred image.
   Taking Fourier transform of the above equation, we get
                      
                        
                                          j 2 ( ux vy )
    G (u, v)              g ( x , y ) e                   dxdy
                   
                       
                       T
                                                           j 2 (uxvy )
                    f ( x  x0 (t ), y  y0 (t ))dt  e                 dxdy
                    0                               
                    
                 T  
                                                                              
                    f ( x  x0 (t ), y  y0 (t ))e  j 2 ( ux vy )
                                                                          dxdydt
                 0                                                       
               T
                                                                        
   G (u, v)      f ( x  x0 (t ), y  y0 (t ))e  j 2 ( ux vy )
                                                                       dxdydt
              0                                                       
                                                       
                T
               F (u, v)e  j 2 (ux0 (t )vy0 (t )) dt
                0
                            T
              F (u, v)  e  j 2 (ux0 (t ) vy0 (t ))dt  F (u, v) H (u, v)
                            0
Then we get, the motion blurring transfer function:
                                    T
                    H (u, v )   e  j 2 ( ux0 ( t )vy0 ( t ))dt
                                     0
 For constant/uniform motion:                         ( x0 (t ), y0 (t ))  (at, bt)
           T
                                                1
H (u, v)   e    j 2 ( ua  vb )
                                      dt              sin( (ua  vb))e  j (ua  vb )T
           0
                                            (ua  vb)
                                                             Motion blurred image
           Original image
                                                              a = b = 0.1, T = 1
Inverse Filter
   From degradation model:
                 G(u, v)  F (u, v) H (u, v)  N (u, v)
 after we obtain H(u,v), we can estimate F(u,v) by the inverse filter:
              ˆ            G ( u, v )                N ( u, v )
              F ( u, v )              F ( u, v ) 
                           H ( u, v )                H (u, v )
 • The expression tells that even if we know the degradation
   function we can’t recover the undegraded image exactly because
   N(u, v) is a random function whose Fourier Transform is not
   known.
 • Further, if the degradation has zero or very small values, then
   the ratio N(u, v) / H(u, v) could dominate the estimate.
• To avoid this problem, we limit the analysis to frequencies
  near the origin, we reduce the probability of encountering
  zero values.
• To avoid the side effect of enhancing noise, we can apply this
  formulation to freq. component (u,v) with in a radius D0 from
  the center of H(u,v).
• Practically, the direct inverse filter is not popularly used.
• Following filters are the improvement over the direct inverse
filtering.
Example: Inverse Filter
                                              Result of applying     Result of applying
     Original image                             the full filter    the filter with D0=40
    Blurred image                           Result of applying    Result of applying
   Due to Turbulence                      the filter with D0=70 the filter with D0=85
                      0.0025( u 2  v 2 )5 / 6
     H ( u, v )  e
Wiener Filter
• Also known as ‘Minimum Mean Square Error’ Filter.
• It incorporates both the degradation function and the statistical
  characteristics of noise into the restoration process.
• It considers images and noise as random variables and the
  objective is to find an estimate of the uncorrupted image such
  that the mean square error between them is minimized.
   This error measure is given by:             
                                        e2  E ( f  fˆ )2   
          where E{..} is the expected value of the argument.
   It is also assumed that the noise and the image are
   uncorrelated; that one or the other has zero mean; and that the
   gray levels in the estimate are a linear function of the levels in
   the degraded image.
Wiener Filter [1942] Formula:
                          H   *
                                 ( u , v ) S   ( u , v ) 
    Fˆ (u, v )                             f
                                                         G ( u , v )
                  S f (u, v ) H (u, v )  S (u, v ) 
                                               2
                            H * ( u, v )               
                                                      G ( u , v )
                H (u, v )  S (u, v ) / S f (u, v ) 
                           2
                1                     H ( u, v )
                                                  2
                                                                  
                                                                G ( u , v )
                H (u, v ) H (u, v )  S (u, v ) / S f (u, v ) 
                                     2
      where          H(u,v) = Degradation function
                     S(u,v) = Power spectrum of noise
                     Sf(u,v) = Power spectrum of the undegraded image
  Note that if the noise reduces to zero, it reduces to inverse filter.
In wiener filter formula:
                  1                     H ( u , v )
                                                     2
                                                                    
    Fˆ (u, v )                                                    G(u, v )
                  H (u, v ) H (u, v )  S (u, v ) / S f (u, v ) 
                                       2
                                                          Difficult to estimate
Approximated Formula: When we are dealing with spectrally
white noise, the power spectrum of noise is constant, which
simplifies things considerably.
                          1           H ( u , v )
                                                   2
                                                     
             Fˆ (u, v)                             G(u, v)
                          H (u, v) H (u, v)  K 
                                               2
Practically, K is chosen manually to obtained the best visual result.!
Example: Wiener Filter
 Original image
    Result of the        Result of the inverse   Result of the
  full inverse filter     filter with D0=70      Wiener filter
Original image
          Blurred image      Result of the
         Due to Turbulence   Wiener filter
 Image                Result of the    Result of the
degraded              inverse filter   Wiener filter
by motion
blur +
AWGN        s2=650
            s2=325
                                                       Note: K is
                                                       chosen
                                                       manually
            s2=130
Geometric Mean Filter
 This filter represents a family of filters combined into a
 single expression
                                                                          1
                                                                         
                                                                        
                  H ( u, v )  
                      *                             *
                                                  H ( u, v )              
    ˆ
    F ( u, v )                                                               G ( u, v )
                                2                                      
                  H ( u , v )                        S   ( u , v )
                                        H ( u, v )                  
                                                  2
                                                       S f (u, v )  
         = 1  the inverse filter
        = 0  the Parametric Wiener filter
        =0.5  Geometric mean filter
        = 0,  = 1  the standard Wiener filter
         = 1,  < 0.5  More like the inverse filter
        = 1,  > 0.5  More like the Wiener filter
        = 1,  = 0.5  spectrum equalization filter
ADAPTIVE FILTERS:A brief introduction
• Filters selected so far are applied to an image without regard for
  how image characteristics vary from one point to another.
• Adaptive filters are a class of filters whose behaviour changes
  based on the statistical characteristics of the image inside the filter
  region defined by the m*n rectangular window Sxy .
• They are capable of a superior performance to the filters discussed
  so far.
• Price paid for improved filtering power is an increase in filter
  complexity
Thank you