Académique Documents
Professionnel Documents
Culture Documents
+ =
N
ux
A y x f
We can present image using sinusoidal variation of the x axis,
about a mean gray level of 128. Amplitude, A is a value in the
range [1,127], N is the width of the image, in pixels. The parameter
u is a dimensionless spatial frequency, corresponding to the
number of complete cycles of the sinusoid that fit into the width of
the image
Where:
- u is the spatial frequency - number of cycles that fit into the
width of the image
- u/N is cycles per pixel -
Images of sinusoidal functions
Of course, we can also have sinusoidal variation in the y
direction. We can introduce a second spatial frequency
parameter , v, representing the number of cycles of
variation that span the height of the image, to deal with this.
Fourier theory- Basic concepts
Basic concepts:
- any periodic function can be represented as a sum of simple
sinusoids
- basis functions - sine and cosine functions of a given frequency
- Fourier series - weighted sum of basis functions - equation 8.2
on is the frequency of a basis function - number of cycles that fit
into one period L
- Fourier series representation of f(x) can be given by two 1D
arrays (of infinite size) of coefficients
- Fourier coefficients - weighting factors for each sine and cosine
function
- example - summation of sinusoids can generate
Fourier theory- Basic concepts
A set of sine and cosine functions having particular
frequencies are chosen for image representation. These
are termed the basis functions of the representation. A
weighted sum of these basic functions is called a Fourier
series. The weighting factors for each sine and cosine
function are known as the Fourier coefficients. We can
write the summation as follows:
|
.
|
\
|
+
|
.
|
\
|
=
=
L
nx
b
L
nx
a x f
n
n
n
t t 2
sin
2
cos ) (
0
The index n is the number of cycles of the sinusoid that
fit within a one period of f(x). Thus n can be considered
as a dimensionless measure of the frequency of a basis
function.
2D Fourier series
1)use 2D sine and cosine functions - equation 8.3
2)Fourier series representation of f(x,y) can be given by two 2D
arrays (of infinite size) of coefficients
3)basis images - figure 8.7
4)coefficients determine contributions of each basis image to the
representation
5) Fourier series
2D Fourier series
where u and v are the number of cycles fitting into one
horizontal and vertical period , respectively of f(x,y). We can
regard the Fourier series representation of f(x,y) as a pair of
two-dimensional arrays of coefficients, each of infinite extent.
(
+
+
(
+
=
=
L
vy ux
b
L
vy ux
a y x f
v u
u v
v u
) ( 2
sin
) ( 2
cos ) , (
,
0 0
,
t t
The Fourier series can be used to represent any image. We can
visualize the basis function as basic images see Figure 8.7.
The coefficients au,v and bu,v determine the relative
contributions of each basis image to the representation
2D Fourier series
Fourier series are expansions of periodic functions f(x) in
terms of an infinite sum of sines and cosines.
Fourier series make calculate the coefficients and in the sum.
The computation and use of the orthogonality relationships of
the sine and cosine functions, which can be used to study of
Fourier series is known as harmonic analysis.
Two functions f(x) and g(x) are orthogonal on the
interval if
Fourier Transform
The Fourier Transform is an important image processing tool which
is used to decompose an image into its sine and cosine components.
The output of the transformation represents the image in the Fourier
or frequency domain, while the input image is the spatial domain
equivalent. In the Fourier domain image, each point represents a
particular frequency contained in the spatial domain image.
The Fourier Transform is used in a wide range of applications, such
as image analysis, image filtering, image reconstruction and image
compression.
The original curve has been sampled over 512
points, which means that, according to the theory we
can simulate it with the sum of 256 sine wave, which
can have any amplitude and any phase difference
from the original signal. The first of the sine waves
has a frequency of 0 which means it is just a straight
line and this always has the average value of the
signal. The second has a frequency 1 (i.e. there is one
wave in the original length of the signal). This has
been drawn so that it starts and finishes at 0 but it
can be moved to the left or right by any distance
required to make it fit. The peak to peak height can
also take on any value. The third sine wave has a
frequency of two etc. The FFT software calculates
the set of these waves with frequencies from 0 to 255
which will add up to give exactly the original wave.
The result is a list of 256 pairs of numbers: we
already know the frequencies (the first is 0 the
second 1 etc) so these pairs of numbers are just the
amplitude of each sine wave and the phase shift
which must be applied to make it fit. This all the
information we need to recreate the original
waveform but before we do that we can filter it by
editing the numbers.
Discrete Fourier Transform (DFT)
When applying Fourier transform to images, we must deal explicitly
with the fact that an image is :
1) Two dimensional
2) Sampled
3) Of finite extent
The DFT is the sampled Fourier Transform and therefore does not
contain all frequencies forming an image, but only a set of samples
which is large enough to fully describe the spatial domain image. The
number of frequencies corresponds to the number of pixels in the spatial
domain image, i.e. the image in the spatial and Fourier domain are of the
same size.
For a square image of size NN, the two-dimensional DFT is given by:
=
(
|
.
|
\
|
+
+
|
.
|
\
|
+
=
1
0
1
0
) ( 2
sin
( 2
cos ) , (
1
) , (
N
x
N
y
N
vy ux
j
N
vy ux
y x f
N
v u F
t t
Discrete Fourier Transform (DFT) How is works
Noting that ) sin ) cos( u u
u
j e
j
+ =
Eulers formula
and DFT can be written is exponential form:
=
+
=
1
0
1
0
/ ) ( 2
) , (
1
) , (
N
x
N
y
N vy ux j
e y x f
N
v u F
t
where f(x,y) is the image in the spatial domain and the exponential
term is the basis function corresponding to each point F(u,v) in the
Fourier space. The equation can be interpreted as: the value of each
point F(u,v) is obtained by multiplying the spatial image with the
corresponding base function and summing the result.
The basis functions are sine and cosine waves with increasing
frequencies, i.e. F(0,0) represents the DC-component of the image
which corresponds to the average brightness and F(N-1,N-1)
represents the highest frequency.
Math Review
Most functions ( including sine, cosine and e
x
) can be represented as
an infinite sun of polynomial terms
......
! 7 ! 6 ! 5 ! 3 ! 2
1
7 6 5 3 2
+ + + + + + + =
x x x x x
x e
x
....
! 6 ! 4 ! 2
1 ) cos(
.....
! 7 ! 5 ! 3
) sin(
6 4 2
7 5 3
+ + =
+ + =
u u u
u
u u u
u u
Letting x=ju, Eulers formula becomes obvious to the most casual
observer:
....)
! 7 ! 5 ! 3
( ...
! 6 ! 4 ! 2
1
..
! 7
) (
! 6
) (
! 5
) (
! 4
) (
! 3
) (
! 2
) (
) ( 1
......
! 7 ! 6 ! 5 ! 3 ! 2
1
7 5 3 6 4 2
7 6 5 4 3 2
7 6 5 3 2
+ + + + = + =
+ + + + + + + + =
+ + + + + + + =
u u u
u
u u u
u u u u u u
u
j
j j j j j j
i
x x x x x
x e
x
Inverse Fourier transform
In a similar way, the Fourier image can be re-transformed to the
spatial domain. The inverse Fourier transform is given by:
=
+
=
1
0
1
0
/ ) ( 2
) , (
1
) , (
N
x
N
y
N vy ux j
e v u F
N
y x f
t
The only material difference is the sigh of the exponent. It is clear
that the forward transform of an N x N image yields an N x N
array of coefficients. Since the inverse transform reconstructs the
original image from this set of coefficients, they must constitute a
complete representation of the information present in the image
=
+
=
1
0
1
0
/ ) ( 2
) , (
1
) , (
N
x
N
y
N vy ux j
e y x f
N
v u F
t
forward transform
Fast Fourier Transform
Fourier Transform is separable, it can be written as
where
Using these two formulas, the spatial domain image is first
transformed into an intermediate image using N one-
dimensional Fourier Transforms. This intermediate image is
then transformed into the final image, again using N one-
dimensional Fourier Transforms. Expressing the two-
dimensional Fourier Transform in terms of a series of 2N
one-dimensional transforms decreases the number of
required computations.
Fast Fourier Transform
Even with these computational savings, the ordinary
one-dimensional DFT has N
2
complexity. This can be
reduced toNLog
2
N if we employ the Fast Fourier
Transform (FFT) to compute the one-dimensional DFTs.
This is a significant improvement, in particular for large
images. There are various forms of the FFT and most of
them restrict the size of the input image that may be
transformed, often to N=2
n
where n is an integer.
Image Transformations Math Review
Let an image f be represented as an M x N matrix of integer
numbers
General transform
can be rewritten as
(1)
(2)
(3)
Image Transformations - Math Review
If P and Q are non-singular (non-zero determinants),
inverse matrices exist and
If P and Q are both symmetric (M=M^T), real, and orthogonal
(M^T M = I), then
and the transform is an orthogonal transform.
(4)
(5)
Fourier transform - Math Review
Let |
JJ
be a transform matrix of size J x J :
The discrete Fourier transform can be defined according to equation (2)
The kernel function of the discrete transform (.8) is
(6)
(7)
(8)
The spectra of an image
The Fourier Transform produces a complex number valued
output image which can be displayed with two images,
either with the real and imaginary part or with magnitude
and phase. In image processing, often only the magnitude
of the Fourier Transform is displayed, as it contains most of
the information of the geometric structure of the spatial
domain image. However, if we want to re-transform the
Fourier image into the correct spatial domain after some
processing in the frequency domain, we must make sure to
preserve both magnitude and phase of the Fourier image.
The spectra of an image
The result of an FFT is always a complex number. This however, is not
complicated, all it means is that we get a pair of numbers and from this
pair we can calculate the pair of numbers we really want from each
harmonic: the amplitude and phase (often called the modulus and
argument).
The result of the FFT is a complex
number
C = a + ib illustrated as the point on the
diagram. The position of this point can
also be described by the distance from
the center of the diagram A and the
angle u with the real axis. A is
amplitude (or modulus) and u is phase
(or argument). Simple algebra tells us
that
Fourier spectra play an important role
The Fourier transform of a real function is a complex function
) , (
) , (
v u i
e v u F
|
=
where R(u,v) and I(u,v) are, respectively, the real and imaginary
components of F(u,v).
The magnitude function |F(u,v)| is called the frequency
spectrum of image f(m,n). The magnitudes correspond to
the amplitudes of the basis images in our Fourier
representation. The array of magnitudes is termed the
amplitude spectrum of the image
Fourier spectra play an important role
The array of phases is termed the phase spectrum.
When the term spectrum is used on its own, the amplitude
spectrum is normally implied.
The power spectrum of an image is simply the square of its amplitude
spectrum :
Part 2 ????