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

Chapter 5

Image Restoration

Enhancement: Basically heuristic procedure designed to manipulate


An image in order to take advantages of psychophysical
Aspects of the human visual system.
So, it is SUBJECTIVE process.

Restoration: Modeling the degradation and applying the inverse


process in order to recover the original image.
So, it is OBJECTIVE process.

Restoration: Spatial Domain and Frequency Domain Methods.

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 1


Chapter 5
Image Restoration

Spatial Domain

Freq. Domain

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 2


Chapter 5
Image Restoration

Source of Noise:
•Image acquisition (digitization) and/or transmission
•Image sensors and environmental conditions

Spatial and Frequency properties of noise:


• Probability Density Function
• Autocorrelation Function
• Power Spectral Density Function

White Noise and Colored Noise


Correlated Noise and Uncorrelated Noise
Spatially Periodic Noise

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 3


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 4


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 5


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 6


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 7


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 8


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 9


Chapter 5
Image Restoration

Estimation of Noise Parameters


Periodic Noise: from Fourier Spectrum and Visually Inspection

Available System: Capturing a set of images of “flat” environments

Captured Image: Estimate the parameters of the PDF from small


patches of reasonably constant gray level

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 10


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 11


Chapter 5
Image Restoration

Restoration in the Presence of


Noise Only-Spatial Filtering

Spatial filtering is the choice in situations when only additive noise


is present.
In fact, enhancement and restoration become almost indistinguishable
disciplines in this particular case.

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 12


Chapter 5
Image Restoration

Mean Filters: Harmonic Mean Filter


Arithmetic Mean Filter:

Works well for salt and other noise but not good for pepper noise

Contra-harmonic Mean Filter


Geometric Mean Filter

Q=order, good for reducing salt and pepper


Achieve relative good smoothing but lose less image noise, Positive Q for pepper noise, negative Q
details for salt noise, Q=0 is arithmetic mean, Q= -1
is harmonic mean
12/20/2020 Digital Image Processing - Ali Aghagolzadeh 13
Chapter 5
Image Restoration

The geometric mean filter


Reduced the noise almost
The same as arithmetic filter
But did less blurring
12/20/2020 Digital Image Processing - Ali Aghagolzadeh 14
Chapter 5
Image Restoration

Both filters did a good job.


Positive order good for
cleaning the background, at
the expense of blurring the
dark area. The opposite is
true for negative order.
Arithmetic mean filter is
good for random noise
like Gaussian or uniform,
but contraharmonic is good
for impulsive noise for
proper sign of Q.

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 15


Chapter 5
Image Restoration

The result of using wrong sign for Q in contraharmoic mean filter.

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 16


Chapter 5
Image Restoration

Order-Statistics Filters
Median Filter Midpoint filter

Good for both bipolar and unipolar impulsive noise Good for random noise like Gaussian and Uniform
Max and Min filters Alpha-Trimmed mean filter

Good for removing pepper noise

Good for combined type of noise like impulsive and random


Like Gaussian and uniform

Good for removing salt noise

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 17


Chapter 5
Image Restoration

This is the original


image

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 18


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 19


Chapter 5
Image Restoration

d=6

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 20


12/20/2020 Digital Image Processing - Ali Aghagolzadeh 21
Chapter 5
Image Restoration

Adaptive Filters
Adaptive, local noise reduction filter

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 22


Chapter 5
Image Restoration

Adaptive Filters
Adaptive, local noise reduction filter

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 23


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 24


12/20/2020 Digital Image Processing - Ali Aghagolzadeh 25
Chapter 5
Image Restoration

Adaptive Median Filter

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 26


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 27


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 28


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 29


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 30


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 31


12/20/2020 Digital Image Processing - Ali Aghagolzadeh 32
Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 33


Chapter 5
Image Restoration

These are band-rejection


Notch filters

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 34


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 35


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 36


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 37


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 38


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 39


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 40


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 41


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 42


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 43


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 44


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 45


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 46


Chapter 5
Image Restoration

Blind Deconvolution

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 47


Chapter 5
Image Restoration

Observed subimage

Estimate of the original image

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 48


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 49


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 50


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 51


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 52


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 53


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 54


12/20/2020 Digital Image Processing - Ali Aghagolzadeh 55
Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 56


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 57


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 58


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 59


Chapter 5
Image Restoration

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 60


Chapter 5
Image Restoration

The problem of having to know something about the degradation


function H is common to all methods discussed before. However, the
Wiener filter presents an additional difficulty: The power spectra of the
undegraded image and noise must be known. We have seen in the
previous slides that it is possible to achieve excellent results using an
given approximation; However, a constant estimate of the ratio of the
power spectra is not always a suitable solution.
The method discussed in this part, requires knowledge of only the mean
and variance of the noise. As discussed before, these parameters usually
can be calculated from a given degraded image, so this is an important
advantage. Another difference is that the Wiener filter is based on
minimizing a statistical criterion and, as such, it is optimal in an average
sense.
12/20/2020 Digital Image Processing - Ali Aghagolzadeh 61
Chapter 5
Image Restoration

The algorithm presented in this section has the notable feature that it
yields an optimal result for each image to which it is applied. Of course,
it is important to keep in mind that these optimality criteria, while
satisfying from a theoretical point of view, are not related to the
dynamics of visual perception. As a result, the choice of one algorithm
over the other will almost always be determined (at least partially) by the
perceived visual quality of the resulting image. By using the definition of
convolution, we can express in vector-matrix form, g = Hf + η. For
example, suppose that g(x,y) and f(x,y) are of size M×N. Then we can
form the first N elements of the vector g by using the image elements in
the first row of g(x, y), the next N elements from the second row and so
on. The resulting vector will have dimensions MN×1. These are also the
dimensions of f and η, as these vectors are formed in the same manner.
12/20/2020 Digital Image Processing - Ali Aghagolzadeh 62
Chapter 5
Image Restoration

The matrix H then has dimensions MN × MN. Its elements are given by
the elements of the convolution integral.
It would be reasonable to come to the conclusion that the restoration
problem can now be reduced to simple matrix manipulations.
Unfortunately, this is not the case. For instance, suppose that we are
working with images of medium size say M = N = 512. Then the vectors
given before would be of dimension 262,144 × 1, and matrix H would
be of dimensions 262,144 × 262,144. Manipulating vectors and matrices
of these sizes is not a trivial task. The problem is complicated further by
the fact H is highly sensitive to noise (after the experiences we had with
the effect of noise in the previous parts, this should not be a surprise).
However, formulating the restoration problem in matrix form does
facilitate derivation of restoration techniques.
12/20/2020 Digital Image Processing - Ali Aghagolzadeh 63
Chapter 5
Image Restoration

 
M 1 N 1
C    2 f ( x, y )
2
g  Hfˆ
2

2

x 0 y 0

w  wT w fˆ
2

 
M 1 N 1
C    2 f ( x, y )
2

x 0 y 0
2
g  Hfˆ 
2

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 64


Chapter 5
Image Restoration

The frequency domain solution to this optimization problem is given by


the expression
 H *
(u , v ) 
Fˆ (u, v)   2
G (u, v)
 H (u, v)   P(u, v) 
2

where γ is a parameter that must be adjusted so that the given constraint


is satisfied, and P(u,v) is the Fourier transform of the function
 0 1 0 
p( x, y )   1 4  1
 0  1 0 
We recognize this function as the Laplacian operator introduced before.
12/20/2020 Digital Image Processing - Ali Aghagolzadeh 65
Chapter 5
Image Restoration

As noted earlier, it is important to keep in mind p(x, y), as well


as all other relevant spatial domain functions, must be properly
padded with zeros prior to computing their Fourier transforms.
Note that the above given equation reduces to inverse filtering
if γ is zero.

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 66


Chapter 5
Image Restoration

The above pictures


are the degraded
pictures given in the
first column of Fig.
5.29. γ is selected
manually (as was
used for Wiener

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 67


Chapter 5
Image Restoration

The above row is the results


of Wiener Filtering and the
second row is the results of
constrained filtering. The
second row is slightly better
for high and medium-noise
cases, but for the low noise
both have the same results.
It is not unexpected, since
we adjusted the γ manually
for better visual results. But
in Wiener Filtering K is the
ratio of two unknown
frequency domain
functions, whose ratio is
seldom constant

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 68


Chapter 5
Image Restoration

As shown in the preceding example, it is possible to adjust the parameter


interactively until acceptable results are achieved. If we are interested in
optimality, then the parameter γ must be adjusted so that the given
constraint is satisfied. A procedure for computing γ by iteration is as
follow:
Define a “residual” vector r as r  g  Hfˆ . Since Fˆ (u , v ) (and by
implication fˆ ) is a function of γ, the r also is a function of this
parameter. It has been shown that  ( )  r r  r is a monotonically
T 2

increasing function of γ. What we want to do is to adjust γ so that


  a  r    a where α is an accuracy factor. If r   ,
2 2 2 2 2

then the desired constraint will be strictly satisfied.

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 69


Chapter 5
Image Restoration

Because  ( ) is monotonic, finding the desired value of γ is not


difficult. One approach is to:
1- Specify an initial value of γ.
2
2- Compute r .
3- Stop if   a  r    a is satisfied; So, you have suitable value for γ.
2 2 2

   a or
2 2
otherwise return to2 step 22 after increasing γ if r
decreasing γ if r    a and use the new value of γ to
recompute the optimum estimate Fˆ (u , v ) .
---------------------------------------------------------------------------------------
Other procedure, such as a Newton-Raphson algorithm, can be used to improve the
speed of convergence. In order to use this algorithm, we need the quantities r 2 and 
2

2
. To compute r , we note that . From which we
obtain r(x, y) by computing the inverse transform of R(u,v).

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 70


Chapter 5
Image Restoration

Computational of 
2
Then leads to an

increasing result. First, consider the variance of the noise over the entire
image, which we estimate by the sample-average method:

where
2
is the sample mean. With reference to the form of r , we note that the
double summation in Eq. for  is equal to  . This gives us the
2 2

expression

This is a most useful result.


12/20/2020 Digital Image Processing - Ali Aghagolzadeh 71
Chapter 5
Image Restoration

It tells us that we can implement an optimum restoration


algorithm by having knowledge of only the mean and variance
of the noise. These quantities are not difficult to estimate,
assuming that the noise and image gray-level values are not
correlated. This is a basic assumption of all the methods
discussed in this chapter.

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 72


Chapter 5
Image Restoration

The initial value of γ=10-5, the correction factor for adjusting γ was 10-6, and the value of α=0.25.The noise parameter
specified were the same used to generate Fig. 5.25. a noise variance of 10-5, and zero mean. The restored result is
almost as good as Fig. 28(c), which was obtained by Wiener filtering with K manually specified for the best visual
results. Fig. 5.31(b) shows what can happen if the wrong estimate of noise parameter are used. In this case, the noise
variance specified was 0.01 and the mean was left at a value of 0. The result in this case is considerably more blurred.
12/20/2020 Digital Image Processing - Ali Aghagolzadeh 73
Chapter 5
Image Restoration

As stated before, it is important to keep in mind that optimum


restoration in the sense of constrained least squares does not
necessarily imply “best” in the visual sense. Depending on the
nature and magnitude of the degradation and noise, the other
parameters in the algorithm for iteratively determining the
optimum estimate also play a role in the final result.
In generally, automatically determined restoration filters yield
inferior results to manual adjustment of filter parameters. This
is particularly true of the constrained least squares filter, which
is completely specified by a single, scalar parameter.

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 74


Chapter 5
Image Restoration

Geometric Mean Filters:


It is possible to generalize, slightly, the Wiener filter discussed before.
The generalization is in the form of the so-called Geometric Mean Filter.

with α and β being positive, real constant. The geometric mean filter
consists of the two expression in brackets raised to the power α and 1-α,
respectively. When α=1, this filter reduces to the inverse filter. With α=0,
the filter becomes the so-called Parametric Wiener Filter, which reduces
to the standard Wiener filter when β=1. If α =1/2, the filter becomes a
product of the two quantities raised to the same power, which is the
definition of the geometric mean, thus giving the filter its name.
12/20/2020 Digital Image Processing - Ali Aghagolzadeh 75
Chapter 5
Image Restoration

Geometric Mean Filters:

With β=1, as α decreases below ½, the filter performance will tend


more toward the inverse filter. Similarly, when α increases above ½,
the filter behave more like the Wiener filter. When α=1/2 and β=1,
the filter also is commonly referred to as Spectrum Equalization
Filter. The above Equation is quit useful when implementing
restoration filter because it really represents a family of filters
combined into a single expression.
12/20/2020 Digital Image Processing - Ali Aghagolzadeh 76
Chapter 5
Image Restoration
Geometric Transformation
Geometric Transformations:
Unlike the techniques discussed before, geometric transformations modify the
spatial relationship between pixels in an image. Geometric transformations
often are called rubber-sheet transformation, because they may be viewed as the
process of “printing” an image on a sheet of rubber and then stretching this
sheet according to some predefined set of rules. In terms of digital image
processing, a geometric transformation consists of two basic operations:

(1) A spatial transformation, which defines the “rearrangement” of pixels on the


image plane;
(2) Gray-level interpolation, which deals with the assignment of gray levels to
pixels in the spatially transformed image.
We discuss in the following sections the fundamental ideas underlying these
concepts, and their use in the context of image restoration.
12/20/2020 Digital Image Processing - Ali Aghagolzadeh 77
Chapter 5
Image Restoration
Geometric Transformation - Spatial
Spatial Transformations:
Suppose that an image f with pixel coordinates (x, y) undergoes geometric
distortion to produce an image g with coordinates (x’, y’). This transformation may
be expressed as x’ = r(x, y) and y’ = s(x, y), where r(x, y) and s(x, y) are the spatial
transformations that produced the geometrically distorted image g(x’, y’). For
example, if r(x,y) = x/2 and s(x, y) = y/2, the “distortion” is simply a shrinking of
the size of f(x,y) by one-half in both spatial directions. If r(x, y) and s(x, y) were
known analytically, recovering f(x, y) from the distorted image g(x’, y’) by
applying the transformations in reverse might be possible theoretically. In practice,
however, formulating a single set of analytical functions r(x, y) and s(x, y) that
describe the geometric distortion process over the entire image plane generally is
not possible. The method used most frequently to overcome this difficulty is to
formulate the spatial relocation of pixels by the use of tiepoints, which are a subset
of pixels whose location in the input (distorted) and output (corrected) images is
known precisely.
12/20/2020 . - Ali Aghagolzadeh
Digital Image Processing 78
Chapter 5
Image Restoration
Geometric Transformation - Spatial
The following Fig. shows quadrilateral regions in a distorted and corresponding
corrected image. The vertices of the quadrilaterals are corresponding tiepoints. Suppose
that the geometric distortion process within the quadrilateral regions is modeled by a
pair of bilinear equations so that and
Then, from previous Eqs. We have
and
Since there are a total of eight known tiepoints, these equations can be solved for the
eight coefficients ci, i = 1, 2, …, 8. The
coefficients constitute the geometric
distortion model used to transform used
to transform all pixels within the
quadrilateral region defined by the
tiepoints used to obtain the coefficients.
In general, enough tiepoints are needed to generate a
set of quadrilaterals that cover the entire image, with
each quadrilateral having its own set of coefficients.

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 79


Chapter 5
Image Restoration
Geometric Transformation - Spatial
One we have the coefficients, the procedure used to generate the corrected (i.e.
restored) image is not difficult. If we want to find the value of the undistorted image at
any point (x0, y0), we simply need to know where in the distorted image f(x0, y0) was
mapped. This we find out by substituting (x0, y0) into the previous given Eqs. to obtain
the geometrically distorted coordinates (x’0, y’0). The value of the point in the
undistorted image that was mapped to (x’0, y’0) is g(x’0, y’0). So we obtain the restored

image value simply by letting fˆ ( x0 , y0 )  g ( x0' , y0' ). For example, to generate

fˆ (0,0) , we substitute (x, y) = (0, 0) into the given Eqs. to obtain a pair of
coordinates (x’, y’) from those Eqs. to obtain a pair of coordinates (x’, y’) from those
equations. Then we let fˆ (0,0)  g ( x ' , y ' ) , where x’ and y’ are the coordinate
values just obtained. Next, we substitute (x, y) = (0, 1) into the given Eqs., obtain
another pair of values (x’, y’), and let fˆ (0,1)  g ( x ' , y ' ) for those coordinate
values. The procedure continues pixel by pixel and row by row until an array whose
size does not exceed the size of image g is obtained.
12/20/2020 Digital Image Processing - Ali Aghagolzadeh 80
Chapter 5
Image Restoration
Geometric Transformation - Spatial
A column (rather than a row) scan would yield identical results. Also,
a bookkeeping procedure is needed to keep track of which
quadrilateral apply at a given pixel location in order to use in order
to use the proper coefficients.
Tiepoints are established by a number of different techniques,
depending on the application. For instance, some image generation
systems having physical artifacts (such as metallic points) embedded
on the imaging sensor itself. These produce a known set of points
(called reseau marks) directly on the image as it is acquired. If the
image is distorted later by some other process (such as an image
display or image reconstruction process), then the image can be
geometrically corrected using the technique just described.
12/20/2020 Digital Image Processing - Ali Aghagolzadeh 81
Chapter 5
Image Restoration
Geometric Transformation – Gray-Level Interpolation

The method discussed in the preceding section steps through integer


values of the coordinates (x, y) to yield the restored image fˆ ( x, y ).
However, depending on the values of the coefficient ci, the Eqs.
given in the previous slides can yield non-integer values for x’ and
y’. Since the distorted image g is digital, its pixel values are
defined only at integer coordinates. Thus using non-integer values
for x’ and y’ causes a mapping into location of g for which no gray
levels are defined. Inferring what the gray-level values at those
locations should be, based only on the pixel values at integer
coordinate locations, then becomes necessary. The technique used
t o
accomplish this is called gray-level interpolation.
12/20/2020 Digital Image Processing - Ali Aghagolzadeh 82
Chapter 5
Image Restoration
Geometric Transformation – Gray-Level Interpolation
The simplest scheme for gray-level
interpolation is based on a nearest
neighbor approach. This method,
also called zero-order interpolation,
is illustrated in this Fig. This Fig.
shows: (1) The mapping of integer
(x, y) coordinates into fractional
Coordinates (x’, y’) by means of the previous given Eqs. (2) The selection of the closest
integer coordinates neighbor to (x’, y’); and (3) The assignment of the gray level of this
nearest neighbor to the pixel located at (x, y). Although nearest neighbor interpolation is
simple to implement, this method often has the drawback of producing undesirable
artifacts, such as distortion of straight edges in images of high resolution. Smoother
results can be obtained but using more sophisticated techniques, such as cubic
convolution interpolation, which fits a surface of the sin(z)/z type through a much larger
number of neighbors (say, 16) in order to obtain a smooth estimate of the gray level at
any desired point.
12/20/2020 Digital Image Processing - Ali Aghagolzadeh 83
Chapter 5
Image Restoration
Geometric Transformation – Gray-Level Interpolation
Typical areas in which smoother approximations generally are required include 3-D graphics
and medical image. The price paid for smoother approximations is additional computational
burden. For general purpose image processing a linear interpolation approach that uses the
gray levels of the four nearest neighbors usually is adequate. This approach is
straightforward. Because the gray level of each of the four integral nearest neighbors of a
non-integral pair of coordinates (x’, y’) is known, the gray-level value at these coordinates,
denoted v(x’, y’), can be interpolated from the values of its neighbors by using the
relationship
where the four coefficients are easily determined from the four equations in four unknowns
that can be written using the four known neighbors of (x’, y’). When this coefficients have
been determined, v(x’, y’) is computed and this value is assigned to the location in f(x, y) that
yielded the spatial mapping into location (x’, y’). It is easy to visualize this procedure with
the aid of the Fig. given the previous slide. The exception is that, instead of using the gray-
level value of the nearest neighbor to (x’, y’), we actually interpolate a value at location
(x’, y’) and use this value for the gray-level assignment at (x, y).

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 84


Chapter 5
Image Restoration
Geometric Transformation – Gray-Level Interpolation

Fig (a). shows an image with 25 regularly spaced


tiepoints (highlighted to enhance visibility of the points
in the picture). Fig. (b) shows a simple rearrangement of
the tiepoints to create geometric distortion. With
reference to the procedure discussed in connection with
the previous Eqs., the coefficients of these equations are
a result of the mapping from the undistorted to the
distorted coordinates. Once the coefficients are known,
we have the model, and we can either distort an image
(for demonstration purposes) or we can recover an
image that was geometrically distorted under the set of
conditions defined by the coefficients.

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 85


Chapter 5
Image Restoration
Geometric Transformation – Gray-Level Interpolation

Suppose that we want to distort the image in Fig. (a).


We simply substitute the value of any pixel (x0, y0)
from that image into the previous given Eqs. and
generate the corresponding coordinates,
(x’0, y’0), which we round off to the closest integer
values. The value of the distorted image at that point
is given by letting g(x’0, y’0) = f(x0, y0), or we can
use gray-level interpolation on the values of f in the
neighborhood of (x0, y0). This is the same process
described in connection with the given Eqs. We are
simply applying it in reverse.

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 86


Chapter 5
Image Restoration
Geometric Transformation – Gray-Level Interpolation

The result of distorting Fig (a) by the method discussed


in the previous slide is shown in Fig. (c), where the
nearest neighbor gray-level assignment scheme was used
. Note that this is fairly severe distortion. If this were the
given image, we would use the method discussed in
connection with the Eqs. given before, and one of the
gray-level assignment techniques discussed here. The
result of this procedure is shown in Fig. (d). The nearest
neighbor gray-level assignment method was employed
again. Note that the geometric correction was
reasonable, but there is a significant number of errors in
gray-level assignments, especially along the boundaries
between the gray and black regions.
12/20/2020 Digital Image Processing - Ali Aghagolzadeh 87
Chapter 5
Image Restoration
Geometric Transformation – Gray-Level Interpolation

Figs. (e) and (f) show the same sequence of


experiment, but using bilinear gray-level interpolation
instead. The improvements are particularly visible in
the boundaries between the gray and black regions.
The images just discussed are so regular and have
such few gray levels in the sharp boundaries that
almost any type of geometric distortion will cause
significant degradation. When image have more
texture, geometric correction errors tend to be less
noticeable.

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 88


Chapter 5
Image Restoration

When image have more texture, geometric


correction errors tend to be less noticeable.
For example, consider the Fig. (a). Fig. (b)
is the result of geometrically distortion in
the same manner as Fig. (e) in the previous
slide. This distortion in Fig. (b) is not
nearly as noticeable. The differences
between Fig. (a) and Fig. (b) are not
insignificant, as the difference image in
Fig. (c) shows. They simply are not as
visible because of the variety of texture in
this image. Finally, Fig. (d), shows the
geometrically corrected image. For all
practical purposes, this image is the same
quality as the original

12/20/2020 Digital Image Processing - Ali Aghagolzadeh 89

You might also like