0% found this document useful (0 votes)
275 views

Image Restoration and Reconstruction

The document discusses image restoration techniques to remove noise from degraded images. It describes how noise is introduced during image acquisition and transmission. Common noise models are analyzed, including Gaussian, Rayleigh, Erlang, exponential, uniform, and impulse noise. Spatial domain filtering techniques such as mean, order statistics, and adaptive filters are covered. Specific mean filters like arithmetic, geometric, harmonic, and contraharmonic are examined. Examples demonstrate applying these filters to images corrupted by different noise types. Choosing the incorrect parameter for filters like the contraharmonic can significantly degrade the image.

Uploaded by

Shakshi Agrawal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
275 views

Image Restoration and Reconstruction

The document discusses image restoration techniques to remove noise from degraded images. It describes how noise is introduced during image acquisition and transmission. Common noise models are analyzed, including Gaussian, Rayleigh, Erlang, exponential, uniform, and impulse noise. Spatial domain filtering techniques such as mean, order statistics, and adaptive filters are covered. Specific mean filters like arithmetic, geometric, harmonic, and contraharmonic are examined. Examples demonstrate applying these filters to images corrupted by different noise types. Choosing the incorrect parameter for filters like the contraharmonic can significantly degrade the image.

Uploaded by

Shakshi Agrawal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 73

Digital Image Processing

IMAGE RESTORATION AND


RECONSTRUCTION
(NOISE REMOVAL)
TOPICS TO COVER

 What is image restoration?


 Noise and images
 Noise models
 Noise removal using spatial domain filtering
 Noise removal using frequency domain filtering
WHAT IS IMAGE RESTORATION?
Image restoration attempts to restore images that
have been degraded
 Identify the degradation process and attempt to
reverse it
 Similar to image enhancement, but more objective
NOISE AND IMAGES

The sources of noise in digital images


arise during image acquisition
(digitization) and transmission
 Imaging sensors can be affected by
ambient conditions
 Interference can be added
to an image during transmission
IMAGE BLURRED BY ATMOSPHERIC
TURBULENCE & WITH ADDITIVE NOISE
INVERSE V/S PSEUDO-INVERSE FILTERING
NOISE MODEL

We can consider a noisy image to be modelled as follows:

g ( x, y)  f ( x, y)   ( x, y)
where f(x, y) is the original image pixel, η(x, y) is the
noise term and g(x, y) is the resulting noisy pixel
If we can estimate the noise model we can figure out how
to restore the image
BLOCK DIAGRAM
NOISE MODELS (CONT...)
There are many different Gaussian Rayleigh
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

models for the image


noise term η(x, y):
 Gaussian
 Most common model Erlang Exponential

 Rayleigh
 Erlang (Gamma)
 Exponential
Uniform
 Uniform Impulse

 Impulse
 Salt and pepper noise
NOISE EXAMPLE
The test pattern to the right is ideal for
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

demonstrating the addition of noise


The following slides will show the
result of adding noise based on various
models to this image

Image

Histogram to go here

Histogram
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Gaussian
NOISE EXAMPLE (CONT…)

Rayleigh
Erlang
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Exponential
NOISE EXAMPLE (CONT…)

Uniform
Impulse
Histogram to go here
RESTORATION USING SPATIAL FILTERING

 Mean Filters
 Order Statistic Filters

 Adaptive Filters
RESTORATION USING SPATIAL FILTERING
Mean Filters:

 Arithmetic mean filter


 Geometric Mean
 Harmonic Mean
 Contraharmonic Mean
ARITHMETIC MEAN FILTER

The arithmetic mean filter is a very simple one


and is calculated as follows:

ˆf ( x, y )  1
 g ( s, t )
mn ( s ,t )S xy
1/ 1/ 1/
9 9 9 This is implemented as the
1/ 1/ 1/ simple smoothing filter by
9 9 9
introducing the blur in the image.
1/ 1/ 1/
9 9 9
OTHER MEANS (CONT…)
Geometric Mean:
1
  mn
fˆ ( x, y )    g ( s, t )
( s ,t )S xy 

Achieves similar smoothing to the arithmetic


mean, but tends to lose less image detail.
OTHER MEANS (CONT…)
Harmonic Mean:
mn
fˆ ( x, y ) 
1

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

Works well for salt noise, but fails for pepper noise.
Also does well for other kinds of noise such as
Gaussian noise.
OTHER MEANS (CONT…)
Contraharmonic Mean:

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

fˆ ( x, y ) 
 g ( s, t )
( s ,t )S xy
Q

Q is the order of the filter.


Positive values of Q eliminate pepper noise.
Negative values of Q eliminate salt noise.
It cannot eliminate both simultaneously.
NOISE REMOVAL EXAMPLES
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image
Original corrupted
image by Gaussian
noise

3x3
Geometric
3x3 Mean Filter
Arithmetic (less blurring
Mean than AMF, the
Filter image is
sharper)
NOISE REMOVAL EXAMPLES (CONT…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image corrupted by
pepper noise at 0.1

Filtering with a 3x3


Contraharmonic Filter
with Q=1.5
NOISE REMOVAL EXAMPLES (CONT…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image corrupted by
salt noise at 0.1

Filtering with a 3x3


Contraharmonic Filter
with Q=-1.5
CONTRAHARMONIC FILTER: HERE BE
DRAGONS
Choosing the wrong value for Q when using the
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

contraharmonic filter can have drastic results

Pepper noise filtered by Salt noise filtered by


a 3x3 CF with Q=-1.5 a 3x3 CF with Q=1.5
ORDER STATISTICS FILTERS
Spatial filters based on ordering the pixel values
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

that make up the neighbourhood defined by the


filter support.

Useful spatial filters include


 Median filter
 Max and min filter
 Midpoint filter
 Alpha trimmed mean filter
NOISE REMOVAL EXAMPLES
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image Result of 1
corrupted pass with a
by Salt And 3x3 Median
Pepper noise Filter
at 0.2

Result of 2 Result of 3
passes with passes with
a 3x3 Median a 3*3 Median
Filter Filter

Repeated passes remove the noise better but also blur the image
fˆ ( x, y)  min {g ( s, t )}
( s ,t )S xy
NOISE REMOVAL EXAMPLES (CONT…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image Image
corrupted corrupted
by Pepper by Salt
noise noise

Filtering Filtering
above above
with a 3x3 with a 3x3
Max Filter Min Filter

1. Max filter will reduce some black pixels which are near to
dark image object.
2. Min Filter will make white pixel also to dark pixel near the
dark image object.
NOISE REMOVAL EXAMPLES (CONT…)
Image Image further
corrupted
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

corrupted
by uniform by Salt and
noise Pepper noise

Filtering by a Filtering by a
5x5 Arithmetic 5x5 Geometric
Mean Filter Mean Filter

Filtering by a Filtering by a
5x5 Median 5x5 Alpha-Trimmed
Filter Mean Filter (d=5)

Note: For higher order of ‘d’ in ATM filter it approaches the result
of median filter.
ADAPTIVE FILTERS
ADVANTAGES
ADAPTIVE MEDIAN FILTERING (CONT…)

The key to understanding the algorithm is to


remember that the adaptive median filter has
three purposes:

 Remove impulse noise


 Provide smoothing of other noise
 Reduce distortion (excessive thinning or thickening of
object boundaries).
ADAPTIVE MEDIAN FILTERING (CONT…)
In the adaptive median filter, the filter size changes
depending on the characteristics of the image.
Notation:
Sxy = the support of the filter centred at (x, y)
zmin = minimum intensity value in Sxy
zmax = maximum intensity value in Sxy
zmed = median of intensity value in Sxy
zxy = intensity value at coordinates (x, y)
Smax = maximum allowed size of Sxy
ADAPTIVE MEDIAN FILTERING (CONT…)
Stage A: A1 = zmed – zmin
A2 = zmed – zmax
If A1 > 0 and A2 < 0, Go to stage B
Else increase the window size
If window size ≤ Smax repeat stage A
Else output zmed

Stage B: B1 = zxy – zmin


B2 = zxy – zmax
If B1 > 0 and B2 < 0, output zxy
Else output zmed
ADAPTIVE MEDIAN FILTERING (CONT…)
Stage A: A1 = zmed – zmin
A2 = zmed – zmax
If A1 > 0 and A2 < 0, Go to stage B
Else increase the window size
If window size ≤ Smax repeat stage A
Else output zmed
Stage A determines if the output of the median filter zmed is
an impulse or not (black or white).
If it is an impulse the window size is increased until it
reaches Smax or zmed is not an impulse.
Note that there is no guarantee that zmed will not be an
impulse. The smaller the the density of the noise is, and,
the larger the support Smax, we expect not to have an
impulse.
ADAPTIVE MEDIAN FILTERING (CONT…)
Stage B: B1 = zxy – zmin
B2 = zxy – zmax
If B1 > 0 and B2 < 0, output zxy
Else output zmed

Stage B determines if the pixel value at (x, y), that


is zxy, is an impulse or not (black or white).
If it is not an impulse, the algorithm outputs the
unchanged pixel value zxy .
If it is an impulse the algorithm outputs the median
zmed .
ADAPTIVE FILTERING EXAMPLE
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Image corrupted by salt Result of filtering with a Result of adaptive


and pepper noise with 7x7 median filter median filtering with
probabilities Pa = Pb=0.25 Smax = 7

AMF preserves sharpness and details, e.g. the connector fingers.


BAND REJECT FILTERS
Removing periodic noise form an image involves
removing a particular range of frequencies from that
image.
Band reject filters can be used for this purpose
An ideal band reject filter is given as follows:

 W
1 if D(u, v)  D0  2
 W W
H (u, v)  0 if D0   D(u, v)  D0 
 2 2
1 if D(u, v)  D0  W
 2
BAND REJECT FILTERS (CONT…)
The ideal band reject filter is shown below, along
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

with Butterworth and Gaussian versions of the


filter

Ideal Band Butterworth Gaussian


Reject Filter Band Reject Band Reject
Filter (of order 1) Filter
BAND REJECT FILTER EXAMPLE
Image corrupted Fourier spectrum
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

by sinusoidal noise of corrupted image

Butterworth band Filtered image


reject filter
NOTCH FILTERS
ESTIMATING THE DEGRADATION FUNCTION

3 main ways to estimate the degradation function


for use in an image restoration:

1. Observation
2. Experimentation
3. Mathematical modeling
ESTIMATION BY IMAGE OBSERVATION

Example1: Image with blur. (Consider each small sub images and try to
find high contrast and the deblur the portion).
Note: This can be achieved by sharpening the Image.
Example2: Restoring Historical Photographs
ESTIMATION BY EXPERIMENTATION
ESTIMATION BY MODELING

a) Negligible
turbulence
b) Severe
Turbulence
with
k=0.0025
c) Mild
turbulence
k=0.001
d) Low
turbulence
k=0.00025
INVERSE FILTERING
a) Normal
Filter
b) Result of H
cut off
outside the
radaii 40
c) Result of H
cut off
outside the
radaii 70
d) Result of H
cut off
outside the
radaii 85
Note: Image
dominated
with the
noise
MINIMUM MEAN SQUARE ERROR
(WIENER) FILTERING

Note: When Noise is zero, then power spectrum vanishes and


Wiener filter results as inverse filter
MINIMUM MEAN SQUARE ERROR
(WIENER) FILTERING

Hint: Considering
the Signal to Noise
ratio in the image
(SNR)

a) Full filter b)inverse filter c)Wiener filter


GEOMETRIC MEAN FILTER
CONSTRAINED LEAST SQUARES
FILTERING
CONSTRAINED LEAST SQUARES
FILTERING
CONSTRAINED LEAST SQUARES
FILTERING
END

You might also like