You are on page 1of 36

Chapter Five

Image Restoration and Reconstruction


(Noise Removal)
Contents

5.1 Introduction
5.2 Models of images and noise
5.3 Estimation of noise parameters
5.4 Restoration in the presence of
noise
Introduction
•Image enhancement: Image enhancement is a technique used to
improve the visual quality of an image by manipulating its
brightness, contrast, or sharpness.
•Image Restoration: Image restoration is a technique used to
remove or reduce the degradation or distortion that an image may
have suffered during acquisition, transmission, or storage.
Major differences between Image enhancement and Image
Restoration
Noise and Images

The sources of noise in digital images


arise during image acquisition
(digitization) and transmission
– Imaging sensors can be affected by
Environment conditions
– Interference(noise) can be added to an
image during transmission
Noise Model

Spatial Domain

Frequency Domain
Noise Models

There are many different models for the image noise


term η(x, y):
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

– Gaussian
• Most common model
– Rayleigh
– Erlang (Gamma)
– Exponential
– Uniform
– Impulse
• Salt and pepper noise
Gaussian Noise Model
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Gaussian noise can degrade image


quality, affecting various image
processing tasks like filtering,
segmentation, and edge detection.

Higher levels of noise (larger variance)


can make images appear grainy or blurry.
Rayleigh Noise Model
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Rayleigh noise affects


images by introducing
variations in intensity,
leading to a right-skewed
distribution of pixel
values. It can cause a loss
of fine details, distortion,
and degradation in image
quality, especially in
regions with higher
intensities.
Erlang (Gamma) Noise Model
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

The specific characteristics and impact of


Erlang noise on images depend on the
values of the shape and rate parameters,
influencing the distribution and spread of
noise across the image.
Exponential Noise Models
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Exponential noise affects images by introducing


variations in pixel intensities following an
exponential distribution.

The impact of exponential noise on an image


depends on the rate parameter λ, with higher
values leading to more pronounced noise
effects.
Uniform Noise Model
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Uniform noise can cause


artifacts in images, resulting in
a salt-and-pepper-like effect
where pixels take on values
within a specified range
uniformly distributed across
the image. The impact of
uniform noise varies depending
on the amplitude and range
specified.
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Impulse Noise Model


Mean and Variance are used for estimating the noise in image
Filters
11 Filtering to Remove Noise
We can use spatial filters of different kinds to
remove different kinds of noise
The arithmetic mean filter is a very simple
one and is calculated as follows:

ˆ 1
f (x, y)   g(s,
mn ( s,t )Sxy

1/
9
1/
9
1/
9 t)
1/ 1/ 1/
This is implemented as the
9 9 9
simple smoothing filter
1/ 1/ 1/
9 9 9
It blurs the image.
12 Other Means
There are different kinds of mean filters all of
which exhibit slightly different behaviour:
– Geometric Mean
– Harmonic Mean
– Contraharmonic Mean
13 Other Means (cont…)
Geometric Mean:
1

  mn
ˆ
f (x, y)    g(s,
 ( s,t )S


t) xy

Achieves similar smoothing to the arithmetic
mean, but tends to lose less image detail.
14 Other Means (cont…)
Harmonic Mean:
mn
fˆ(x, y)  1
 g(s,
( s,t ) xy
S
t)
Works well for salt noise, but fails for pepper
noise.
Also does well for other kinds of noise such as
Gaussian noise.
15 Other Means (cont…)
Contraharmonic Mean:

 g(s, t) Q 1
fˆ (x, y) 
( s ,t )S xy
( s,t )S xy
 g(s, t) 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.
20 Order Statistics Filters
Spatial filters based on ordering the pixel
values that make up the neighbourhood
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

defined by the filter support.

Useful spatial filters include


– Median filter
– Max and min filter
– Midpoint filter
– Alpha trimmed mean filter
21 Median Filter
Median Filter:
fˆ (x, y)  median{g(s, t)}
( s,t )S xy

Excellent at noise removal, without the


smoothing effects that can occur with other
smoothing filters.

Particularly good when salt and pepper


noise is present.
22 Max and Min Filter
Max Filter:
fˆ (x, y)  max {g(s, t)}
( s,t )S xy

Min Filter:
fˆ (x, y)  min {g(s, t)}
( s,t )S xy

Max filter is good for pepper noise and Min


filter is good for salt noise.
23 Midpoint Filter
Midpoint Filter:

1
ˆ
f (x, y)   maxxy {g(s, t)} ( s,tmin
) {g(s, 
2 ( s,t ) S
xy

t)} S

Good for random Gaussian and uniform


noise.
24 Alpha-Trimmed Mean Filter
Alpha-Trimmed Mean Filter:

ˆ 1
f (x, y)  mn  g
r
(s,
( s,t )S x
d y
t)
We can delete the d/2 lowest and d/2 highest
grey levels.
So gr(s, t) represents the remaining mn – d
pixels.
28 Adaptive Filters
The filters discussed so far are applied to an
entire image without any regard for how image
characteristics vary from one point to another.
The behaviour of adaptive filters changes
depending on the characteristics of the image
inside the filter region.
We will take a look at the adaptive median
filter.
29 Adaptive Median Filtering
The median filter performs relatively well on
impulse noise as long as the spatial density of
the impulse noise is not large.

The adaptive median filter can handle much


more spatially dense impulse noise, and also
performs some smoothing for non- impulse
noise.
30 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
thickenning of object boundaries).
31 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 centerd at (x, y)


= minimum grey level in Sxy
– zmin
= maximum grey level in Sxy
– zmax = median of grey levels in Sxy
– zmed = grey level at coordinates (x, y)
– zxy
=maximum allowed size of Sxy
S
32 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 z
33 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 not an impulse, we go to stage B.
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.
34 Adaptive Median Filtering (cont…)
Stage B: B1 = zxy – zmin
B2 = zxy – zmax
If B1 > 0 and
B2 < 0,
output zxy
Stage B determines if the pixel value at (x, y), that is zxy,
Else output
is an impulsezmed
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 .
36 Periodic Noise
Typically arises due to
electrical or electromagnetic
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

interference.
Gives rise to regular noise
patterns in an image.
Frequency domain
techniques in the Fourier
domain are most effective at
removing periodic noise.
37 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)  0
 D 2
H (u, v)  0 if D0 W  D(u, v)  D0 W
 2
 W2
1 if D(u, v)  D0 
2
38 Band Reject Filters (cont…)
The ideal band reject filter is shown below,
along with Butterworth and Gaussian versions of
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

the filter

Ideal Band Butterworth Band Gaussian


Reject Filter Reject Filter (of Band Reject
order 1) Filter
39 Band Reject Filter Example
Image corrupted by Fourier spectrum of
sinusoidal noise corrupted image
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Butterworth band Filtered image


reject filter

You might also like