Image Processing Lecture 9
Image Restoration
Image restoration attempts to reconstruct or recover an image that has
been degraded by a degradation phenomenon. As in image enhancement,
the ultimate goal of restoration techniques is to improve an image in some
predefined sense.
Image restoration vs. image enhancement
Image restoration Image enhancement
1. is an objective process is a subjective process
2. formulates a criterion of involves heuristic procedures
goodness that will designed to manipulate an image
yield an optimal estimate of the in order to satisfy the human
desired result visual system
3. Techniques include noise Techniques include contrast
removal and deblurring (removal stretching
of image blur)
Like enhancement techniques, restoration techniques can be performed in
the spatial domain and frequency domain. For example, noise removal is
applicable using spatial domain filters whereas deblurring is performed
using frequency domain filters.
A Model of Image Degradation & Restoration
As shown in the next figure, image degradation is a process that acts on
an input image f(x,y) through a degradation function H and an additive
noise η(x,y). It results in a degraded image g(x,y) such that:
Asst. Lec. Wasseem Nahy Ibrahem Page 1
Image Processing Lecture 9
where h(x,y) is the spatial representation of the degradation function and
the symbol “ * ” indicates convolution.
Note that we only have the degraded image g(x,y). The objective of
restoration is to obtain an estimate of the original image. We
want the estimate to be as close as possible to the original input image
and, in general, the more we know about H and η, the closer will
be to f(x, y).
Figure 9.1 A model of the image degradation/restoration process
In the frequency domain, this model is equivalent to:
The approach that we will study is based on various types of image
restoration filters. We assume that H is the identity operator, and we deal
only with degradations due to noise.
Asst. Lec. Wasseem Nahy Ibrahem Page 2
Image Processing Lecture 9
Noise and its characteristics
Noise in digital images arises during:
• Acquisition: environmental conditions (light level & sensor
temperature), and type of cameras
• and/or transmission – interference in the transmission channel
To remove noise we need to understand the spatial characteristics of
noise and its frequency characteristics (Fourier spectrum).
Generally, spatial noise is assumed to be independent of position in
an image and uncorrelated to the image itself (i.e. there is no correlation
between pixel values and the values of noise components). Frequency
properties refer to the frequency content of noise in the Fourier sense.
Noise Models
Spatial noise is described by the statistical behavior of the gray-level
values in the noise component of the degraded image. Noise can be
modeled as a random variable with a specific probability distribution
function (PDF). Important examples of noise models include:
1. Gaussian Noise
2. Rayleigh Noise
3. Gamma Noise
4. Exponential Noise
5. Uniform Noise
6. Impulse (Salt & Pepper) Noise
Asst. Lec. Wasseem Nahy Ibrahem Page 3
Image Processing Lecture 9
Gaussian Noise
The PDF of Gaussian noise is given by
Figure 9.2 Gaussian noise PDF
where z is the gray value, μ is the mean and σ is the standard deviation.
Rayleigh Noise
The PDF of Rayleigh noise is given by
Figure 9.3 Rayleigh noise PDF
Asst. Lec. Wasseem Nahy Ibrahem Page 4
Image Processing Lecture 9
Impulse (Salt & Pepper) Noise
The PDF of impulse noise is given by
Figure 9.4 Impulse noise PDF
If b > a, then gray level b appears as a light dot (salt), otherwise the gray
level a appears as a dark dot (pepper).
Determining noise models
The simple image below is well-suited test pattern for illustrating the
effect of adding various noise models.
Figure 9.5 Test pattern used to illustrate
the characteristics of the noise models
The next figure shows degraded (noisy) images resulted from adding the
previous noise models to the above test pattern image.
Asst. Lec. Wasseem Nahy Ibrahem Page 5
Image Processing Lecture 9
Gaussian Rayleigh Gamma
Exponential Uniform Salt & Pepper
Figure 9.6 Images and histograms from adding Gaussian, Rayleigh, Gamma, Exponential,
Uniform, and Salt & Pepper noise.
Asst. Lec. Wasseem Nahy Ibrahem Page 6
Image Processing Lecture 9
To determine the noise model in a noisy image, one may select a
relatively small rectangular sub-image of relatively smooth region. The
histogram of the sub-image approximates the probability distribution of
the corrupting model of noise. This is illustrated in the figure below.
(a) (b) (c)
(d) (e) (f)
Figure 9.10 (a) Gaussian noisy image. (b) sub-image extracted from a. (c) histogram of b
(d) Rayleigh noisy image. (e) sub-image extracted from d. (f) histogram of e
Image restoration in the presence of Noise Only
When the only degradation present in an image is noise, the degradation
is modeled as:
and
Asst. Lec. Wasseem Nahy Ibrahem Page 7
Image Processing Lecture 9
Spatial filtering is the method of choice in situations when only additive
noise is present. Spatial filters that designed to remove noise include:
1. Order Statistics Filters: e.g. Min, Max, & Median
2. Adaptive Filters: e.g. adaptive median filter
Order-Statistics Filters
We have used one of these filters (i.e. median) in the image enhancement.
We now use additional filters (min and max) in image restoration.
Min filter
This filter is useful for finding the darkest points in an image. Also, it
reduces salt noise as a result of the min operation.
(a) (b)
Figure 9.11 (a) image corrupted by salt noise. (b) Result of filtering (a) with a 3×3 min filter.
Max filter
This filter is useful for finding the brightest points in an image. Also,
because pepper noise has very low values, it is reduced by this filter as a
result of the max operation.
Asst. Lec. Wasseem Nahy Ibrahem Page 8
Image Processing Lecture 9
(a) (b)
Figure 9.12 (a) image corrupted by pepper noise. (b) Result of filtering (a) with a 3×3 max
filter.
Adaptive Filters
The previous spatial filters are applied regardless of local image
variation. Adaptive filters change their behavior using local statistical
parameters in the mask region. Consequently, adaptive filters outperform
the non-adaptive ones.
Adaptive median filter
The median filter performs well as long as the spatial density of the
impulse noise is not large (i.e. Pa and Pb less than 0.2). Adaptive median
filtering can handle impulse noise with probabilities even larger than
these. Moreover the adaptive median filter seeks to preserve detail while
smoothing non-impulse noise, while the median filter does not do.
The adaptive median filter aims to replace f(x,y) with the median
of a neighborhood up to a specified size as long as the median is different
from the max and min values but f(x,y)=min or f(x,y)=max. Otherwise,
f(x,y) is not changed.
Asst. Lec. Wasseem Nahy Ibrahem Page 9
Image Processing Lecture 9
Consider the following notation:
Sxy = mask region (neighborhood sub-image)
zmin = minimum gray level value in Sxy
zmax = maximum gray level value in Sxy
zmed = median of gray levels in Sxy
zxy = gray level at coordinates (x, y)
Smax = maximum allowed size of Sxy
The adaptive median filtering algorithm works in two levels A and B as
follows:
Level A: A1 = zmed - zmin
A2 = zmed - zmax
If A1 > 0 AND A2 < 0, Go to level B
Else increase the window size
If window size <= Smax repeat level A
Else output zmed.
Level B: B1 = zxy - zmin
B2 = zxy - zmax
If B1 > 0 AND B2 < 0, output zxy
Else output zmed.
The next figure shows an example of filtering an image corrupted by salt-
and-pepper noise with density 0.25 using 7×7 median filter and the
adaptive median filter with Smax = 7.
Asst. Lec. Wasseem Nahy Ibrahem Page 10
Image Processing Lecture 9
(a)
(b) (c)
Figure 9.13 (a) Image corrupted by salt&pepper noise with density 0.25. (b) Result obtained
using a 7×7 median filter. (c) Result obtained using adaptive median filter with Smax = 7.
From this example, we find that the adaptive median filter has three main
purposes:
1. to remove salt-and-pepper (impulse) noise.
2. to provide smoothing of other noise that may not be impulsive.
3. to reduce distortion, such as excessive thinning or thickening of
object boundaries.
Asst. Lec. Wasseem Nahy Ibrahem Page 11