EEE F435 (2020-21-I) : Digital Image Processing

Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

EEE F435 (2020-21-I)

Digital Image Processing


(Image Enhancement : Image Restoration-I)
BITS Pilani Ashish Chittora
K K Birla Goa Campus
What is Image Restoration?
• Image restoration is a technique to reconstruct or recover an image that has been
degraded, by using a priori knowledge of the degradation phenomenon.

• For the most part, image restoration is an objective process as opposed to image
enhancement.

• Some restoration techniques are best formulated in the SPATIAL domain, while
others are better suited for FREQUENCY domain.

• For example, when the only degradation is ADDITIVE NOISE, spatial processing is
applicable.

• On the other hand, degradations such as IMAGE BLUR are best approached using
frequency domain filters.
A Model of the Image
Restoration/Degradation Process
• The following diagram shows the degradation process modelled as a degradation
function H that, together with an additive noise η(x,y), operates on an input image
f(x,y),to produce a degraded image g(x,y).
• Given g(x,y), some knowledge about H and η(x,y), the objective of image restoration
is to obtain an estimate, of the original input image.
• If H is a linear position-invariant process ,then the degraded image is given in the
spatial domain by
g(x,y) = h(x,y) * f(x,y) + η(x,y)
and in frequency domain G(u,v) = H(u,v)F(u,v) + N(u,v)
Some Important Noise

Probability Density Functions


Gaussian Noise
• Gaussian noise models are used
frequently in practice because of
its tractability in both the spatial
and the frequency domains.

• PDF of a Gaussian random


variable is given by
p(z) = 1/√2πσ *exp[-(z-μ )2 / 2σ2]

• Here z represents gray level, μ is


the mean of the avg. value of z,
and σ is its std. deviation.
Rayleigh Noise

• The PDF of Rayleigh noise is given by


p(z) = { 2/b *(z-a) exp[-(z-a)2/b] ; z>=a
0 ; z<a }

• The mean value and variance of this


density are given by
μ = a+ √(πb/4) and σ2 = b(4-π)/4.
Erlang(Gamma) Noise
• The PDF of Erlang noise is given
by
p(z) = { abzb-1/(b-1)! * e-az ; z>=0
0 ; z<0 }
where the parameters are such
that a>0, and b is a positive
integer.

• μ = b/a and σ2 = b/a2


Exponential Noise

• The PDF of exponential noise is


given by
p(z) = { ae-az ; z>=0
0 ; z<0 }

• μ = 1/a =and σ2 = 1/a2


Uniform Noise

• The PDF of uniform noise is given


by
p(z) = { 1/(b-a) ; a<=z<=b
0 ; otherwise
}

• μ = (a+b)/2 and σ2 = (b-a)2/12


Impulse(Salt and Pepper) Noise
• The PDF of impulse noise is given
by
p(z) = { Pa ; z=a
Pb ; z=b
0 otherwise }
• If b>a , gray level b will appear as a
light dot in the image and level a
will appear as a black dot.
• If either Pa or Pb is zero, impulse
noise is called UNIPOLAR NOISE.
• If neither Pa or Pb is zero, and
especially if both are approx. equal,
impulse noise is called BIPOLAR or
SALT AND PEPPER NOISE.
IMAGE DEGRADATION WITH
ADDITIVE NOISE

Degraded images

Original image

Histogram
IMAGE DEGRADATION WITH
ADDITIVE NOISE (CONTD.)

Degraded images

Original image

Histogram
Periodic Noise

• It is a type of noise which is Image


dependent on spatial co- corrupted
ordinates. by
sinusoidal
• There exists a correlation noise
between the pixel values of
the image and the values of
noise components.
Spectrum
of the
image
• This noise arises typically
from electrical or
electromechanical
interference during image
acquisition.
Restoration in the presence of
Noise Only
Spatial Filtering
MEAN FILTERS
Original
image
 ARITHMETIC MEAN FILTER

• Simplest of mean filters

• Value of restored image Image


corrupted
1
fˆ ( x, y )   g ( s, t )
mn ( s ,t )S xy
by AWGN

; Sxy represents the set of co-ordinates in a


rectangular subimage window of size m*n,
centered at point (x,y). Image
obtained
using a 3x3
• Simply smoothes local variations in an
arithmetic
image
mean filter
Original
 GEOMETRIC MEAN FILTER image

• Value of restored image


1
  mn Image
f ( x, y )    g ( s, t ) 
ˆ corrupted
 ( s ,t )S 
 xy  by AWGN

; Sxy represents the set of co-ordinates in a


rectangular subimage window of size m*n,
centered at point (x,y).
Image
obtained
• Smoothing achieved is comparable with
using a 3x3
arithmetic mean filter but some image
geometric
details are lost.
mean filter
 HARMONIC MEAN FILTER  CONTRAHARMONIC MEAN
FILTER
• Value of restored image • Value of restored image

fˆ ( x , y ) 
mn  g ( s , t ) Q 1

fˆ ( x, y ) 
1 ( s ,t )S xy

( s ,t )S xy g ( s, t )  g ( s , t ) Q

( s ,t )S xy

• Works well with salt noise, but fails where Q is called the order of the filter
for pepper noise • Well suited for reducing or virtually
eliminating the effects of salt and
pepper noise
• Also does well with gaussian noise

• Cannot eliminate both the types of


noise simultaneously
Image Image
corrupted corrupted
by pepper by salt
noise with noise with
prob. = 0.1 prob. = 0.1

Image Image
obtained obtained
using a 3x3 using a 3x3
contra- contra-
harmonic harmonic
mean filter mean filter
With Q = 1.5 With Q=-1.5
ORDER -STATISTICS FILTERS
•These are a set of nonlinear spatial filters.

•Their response is based on ordering(ranking) the pixels contained in the image area
encompassed by the filter, and then replacing the value of the central pixel with the
value determined by the ranking result.

Statistic parameters
subimage Mean, Median, Mode,
Min, Max, Etc.
Moving
window
Output image
 MEDIAN FILTER

• Best known order-statistics filter


• Replaces value of a pixel by the median of the gray levels in
the neighborhood of that pixel.
• Value of restored image

fˆ ( x, y )  median g ( s, t )
( s ,t )S xy

• Quite popular because,for certain types of random noise,


they provide excellent noise reduction capabilities
• Particularly effective in presence of both unipolar and bipolar
impulse noise.
Working of a Median Filter
Salt noise
Pepper noise
Median

Sorted
Degraded image Moving array
window

Filter output

Normally, impulse noise has high magnitude and is isolated. When we sort

pixels in the moving window, noise pixels are usually at the ends of the

array. Therefore, it’s rare that the noise pixel will be a median value.
MEDIAN FILTER EXAMPLE
1 2

Image
corrupted
by salt-and-
pepper
noise with
pa=pb= 0.1

3 4

Images obtained using a 3x3 median filter


 MAX FILTER
• As suggested by name, it replaces value of a pixel by the maximum of the
gray levels in the neighborhood of the pixel.
• Value of restored image : fˆ ( x, y )  max g ( s, t )
( s ,t )S xy

• Useful for finding brightest points in an image


• As a result of max operation, pepper noise gets reduced considerably.

 MIN FILTER
• Replaces value of a pixel by the minimum of the gray levels in the
neighborhood of the pixel.
• Value of restored image : fˆ ( x, y )  min g ( s, t )
( s ,t )S xy

• Useful for finding darkest points in an image


• As a result of min operation, salt noise gets reduced considerably.
MAX AND MIN FILTERS EXAMPLE
Image Image
corrupted corrupted
by pepper by salt
noise with noise with
prob. = 0.1 prob. = 0.1

Image Image
obtained obtained
using a 3x3 using a 3x3
max filter min filter
Periodic Noise Removal By
Frequency Domain Filtering
 BANDREJECT FILTERS

From left to right, perspective plots of ideal, Butterworth (order 1), and

Gaussian bandreject filters are shown.


EXAMPLE OF BANDREJECT FILTERING:
Degraded image DFT

Band reject filter Restored image


 BANDPASS FILTERS

Degraded image Noise pattern of degraded image


obtained by bandpass filtering

 Here, bandpass filtering helped isolate the


noise pattern
NOTCH FILTERS

Perspective plots of (a)ideal, (b)Butterworth of order 2, and (c)Gaussian notch


filters
EXAMPLE OF NOTCH FILTERING:

Degraded Image DFT Notch Filter(Freq.domain)

Restored
Noise
Image
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

You might also like