Você está na página 1de 37

DFT PROPERTIES

Basis images of 2-D DFT


FT use smoothly-varying sinusoidal patterns at
different frequencies, angles for basis images

Basis images
Brightness Image

Fourier transform

Basis images
Brightness Image

Fourier transform

Basis images
Brightness Image

Fourier transform

1 1

1 1
1 1

1 1
1

j

1
j

1 1 1
1 1 1
1 1 1

1 1 1
1
1
j j
1
j

1 1
1 1

1 1

1 1
1
1

j
j
1 1

j j

1
j
1
1
1
1
1
j
1
j

j 1
j 1
j 1
j 1

1 1 1
1 1 1
1 1 1

1 1 1
1
j 1
1
j
1 j
j
1 j 1

1 j 1 j

j 1
j 1
j 1

j 1
j

1
1

j 1 j
j 1 j
j 1 j

1 j 1 j
1 1
1 1 1

j j
j j
j
1 1
1 1 1


j j
j
j j
1 1 j 1 j 1 1 1 1 1
1 1 j
1 j 1 1 1 1 1
1 1 j 1 j 1 1 1 1 1



1 1 j
1 j 1 1 1 1 1
1 1 j 1
j 1 1 1 1
j j
1 j 1 j j
j j
1 1
j
1 j 1 1 1 1



j j 1
j
1 j
j j
j

1 j
j 1
j

j 1
j 1
j

j 1
1 j
j

1 j

j 1

1
j

j 1

1 j

j 1
1
j

j 1

Basis images of 2-D DFT, N=4


Real Part - Cos

Imaginary Part - Sin

Fourier Spectrum Examples

The images are a pure horizontal cosine of 8 cycles


and a pure vertical cosine of 32 cycles.
The FT for each just has a single component,
represented by 2 bright spots symmetrically placed
about the center of the FT image.
The a dot at the center that represents the (0,0)
frequency term or average value of the image.
Images usually have a large average value (like
128) and lots of low frequency information.
The high frequencies in the vertical direction will
cause bright dots away from the center in the
vertical direction.
The high frequencies in the horizontal direction will
cause bright dots away from the center in the
horizontal direction.

2-D DFT Equations

The 2-D Discrete Fourier Transform pair can be


written as:
N 1 N 1

F (u , v) f ( x, y ) e

j 2 u x
N

j 2 v y
N

u , v 0....N 1

x 0 y 0

1
f ( x, y ) 2
N

N 1 N 1

F (u, v) e
u 0 v 0

j 2 u x
N

j 2 v y
N

x, y 0....N 1

DFT Properties

Separability:
N 1 N 1

F (u , v) f ( x, y ) e

j 2 u x
N

j 2 v y
N

x 0 y 0

N 1

N 1

x 0

y 0

e j 2ux f ( x, y )e
N 1

f ( x, v)e j 2ux
x 0

j 2 v y
N

u , v 0....N 1

DFT Properties

To take the two-dimensional Fourier Transform,


one can take a 1-dimensional along one of the axis
and take the second DFT on new results along the
other axis.

DFT Properties

Translation (Shifting): The translation properties


of the Fourier transform pair can be written as

f ( x x0 , y y0 ) DFT
F (u, v) e
f ( x, y ) e

j 2 ( u 0 x v0 y )
N

j 2 ( u 0 x v0 y )
N

DFT
F (u u0 , v v0 )

DFT Properties Cont..

Consider u0 = v0 = N/2, substitution of the


values to the second pair of equation
implies

Shift of the Fourier spectrum to the (N/2,N/2)


point.
So multiplication of input f(x,y) by (-1)x+y shift
the origin of the Fourier spectrum to the centre
of its corresponding NxN frequency square.

exp [j2(Nx+Ny)/2N] = (-1)x+y

DFT Properties Cont..

DFT Properties Cont..

Periodicity and Conjugate symmetry: The discrete


fourier transform and its inverse are periodic with
period N.
F(x,y) = F(u+N,v) = F(u,v+N) = F(u+N,v+N)
Only one period of the transform is necessary to
specify F(u,v) completely in the frequency
domain.

DFT Properties Cont..

If f(x,y) is real, the fourier transform also exhibits


conjugate symmetry.

F(u,v) = F*(-u,-v) or
|F(u,v)| = |F(-u,-v)|

DFT & its Spectrum

Fourier Spectrum

Example
8 8i 8 8 8i
0
0
0
32
0
0
0

0
0
0
0

72 8 8i 8 8 8i
0

0
0
0

72
0

32

0
0

0
0

8 8i 8 8 8i
0
0
0
32
0
0
0

0
0
0
0

72 8 8i 8 8 8i
0

0
0
0

72
0

0 32

0 0

0
0

0
0

Example
150

-10+8i

-10

-10-8i

-2

-2

-34

2
38+40i

-38-40i

-34

-2

-2

-2

-10

-10-8i

150

-10+8i

-34-40i

2
38+40i

A= [ 1 2 3 4; 5 6 7 8; 9 12 13 14; 15 16 17 18];

DFT Properties Cont..

Scaling:

1
f (ax, by )
F (u a , v b )
ab

DFT Properties Cont..

Convolution Theorem:

DFT

f(x,y) * g(x,y)
F(u,v) G(u,v)
DFT

F(u,v) * G(u,v)
f(x,y) g(x,y)
If f(x,y) is of length M1xN1 and g(x,y) is of
length M2x N2 the summation limits M and N
should be,

M M1+M2-1

N N1+N2-1

Fourier Spectrum Examples

Rotation of the image results


in equivalent rotation of its
FT.
FT always treats an image as
if it were part of a
periodically replicated array
of identical images extending
horizontally and vertically to
infinity. And there are strong
edge effects between the
neighbors of such a periodic
array.

Fourier Spectrum Examples

These edge effects can be significantly


reduced by "windowing" the image with a
function that slowly tapers off to a medium
gray at the edge.

Centralized Fourier Spectrum


The dynamic range of
the values in the
spectrum is very large.
So a log transformation
is used.

Fourier Spectrum Examples Cont..

IMAGE AND PHASE

Role of phase in an image

The translation property of Fourier transform is


considered and it says that a linear phase shift in one
domain represents a constant shift in the other
domain.
f ( x, y ) e

j 2 ( u 0 x v0 y )
N

DFT
F (u u0 , v v0 )

f ( x x0 , y y0 ) DFT
F (u , v) e

j 2 ( u 0 x v 0 y )
N

Role of phase in an image Cont..

If an image is shifted by a constant amount its


magnitude spectrum will not be affected. That is
F (u , v ) e

j 2 ( u 0 x v0 y )
N

F (u , v )

If we are using a 2-D filter, H(u,v) for filtering our


image i(x,y), where H(u,v)=A(x,y)exp(-j2 (ax+by)/N),
then the resulting reconstructed image will be i(x-a,y-b)

Role of phase in an image Cont..

Now if the filter phase characteristic is non


linear a phase distorted image will result.
That is each pixel will receive a different
spatial shift dependent on the spatial position,
and the resultant image will be

i(x - f(x,y), y - f(x,y)), f is some function of spatial


position.

Examples

e.g. Program

f=imread('lena.bmp');
f1=im2double(f);
figure(1), imshow(f);
F1 = zeros(256,256);
for u=1:256
for v=1:256
F1(u,256+1-v) = f1(u,v);
end
end
figure(2), imshow(F1);
Ff = fft2(F1);
Fo = fft2(f1);
ao1=angle(Fo);
ao2=sqrt(real(Fo).^2 + imag(Fo).^2);
a1=angle(Ff);
a2= sqrt(real(Ff).^2 + imag(Ff).^2);

e.g. Program

Z1 = a2.*exp(i*ao1);
Z2 = ao2.*exp(i*a1);
R1 = ifft2(Z1);
R2 = ifft2(Z2);
figure(3), imshow(R1,[ ]);
figure(4), imshow(R2,[ ]);
for u=1:256
for v=1:256
F3(u,v) = cos(a1(u,v))+i*sin(a1(u,v));
end
end
R3=ifft2(F3);
figure(5), imshow(R3,[]);

Você também pode gostar