Chapter 7: The Fourier Transform 7.1 Introduction
description
Transcript of Chapter 7: The Fourier Transform 7.1 Introduction
![Page 1: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/1.jpg)
1
Chapter 7: The Fourier Transform7.1 Introduction
• The Fourier transform allows us to perform tasks that would be impossible to perform any other way
• It is more efficient to use the Fourier transform than a spatial filter for a large filter
• The Fourier transform also allows us to isolate and process particular image frequencies
![Page 2: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/2.jpg)
2
7.2 Background
![Page 3: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/3.jpg)
3
FIGURE 7.2• A periodic function may be written as the sum of sines and
cosines of varying amplitudes and frequencies
![Page 4: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/4.jpg)
4
7.2 Background
These are the equations for the Fourier series expansion of f (x), and they can be expressed in complex form
Fourier series
![Page 5: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/5.jpg)
5
7.2 Background If the function is nonperiodic, we can obtain similar
results by letting T → ∞, in which case
Fourier transform pair
![Page 6: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/6.jpg)
6
7.3 The One-Dimensional Discrete Fourier Transform
![Page 7: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/7.jpg)
7
7.3 The One-Dimensional Discrete Fourier Transform
• Definition of the One-Dimensional DFT
This definition can be expressed as a matrix multiplication
where F is an N × N matrix defined by
![Page 8: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/8.jpg)
8
7.3 The One-Dimensional Discrete Fourier Transform
Given N, we shall define
e.g. suppose f = [1, 2, 3, 4] so that N = 4. Then
![Page 9: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/9.jpg)
9
7.3 The One-Dimensional Discrete Fourier Transform
![Page 10: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/10.jpg)
10
• THE INVERSE DFT
If you compare Equation (7.3) with Equation 7.2 you will see that there are really only two differences:1. There is no scaling factor 1/N
2. The sign inside the exponential function has been changed to positive.
3. The index of the sum is u, instead of x
7.3 The One-Dimensional Discrete Fourier Transform
![Page 11: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/11.jpg)
11
7.3 The One-Dimensional Discrete Fourier Transform
![Page 12: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/12.jpg)
12
7.3 The One-Dimensional Discrete Fourier Transform
![Page 13: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/13.jpg)
13
7.4 Properties of the One-Dimensional DFT
• LINEARITY This is a direct consequence of the definition of the DFT as
a matrix product Suppose f and g are two vectors of equal length, and p and q are scalars, with h = pf + qg If F, G, and H are the DFT’s of f, g, and h, respectively, we
have• SHIFTING
Suppose we multiply each element xn of a vector x by (−1)n. In other words, we change the sign of every second element
Let the resulting vector be denoted x’. The DFT X’ of x’ is equal to the DFT X of x with the swapping of the left and right halves
![Page 14: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/14.jpg)
14
7.4 Properties of the One-Dimensional DFT
e.g.
![Page 15: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/15.jpg)
15
7.4 Properties of the One-Dimensional DFT
Notice that the first four elements of X are the last four elements of X1 and vice versa
![Page 16: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/16.jpg)
16
• SCALINGwhere k is a scalar and F= f If you make the function wider in the x-direction, it's
spectrum will become smaller in the x-direction, and vice versa
Amplitude will also be changed
7.4 Properties of the One-Dimensional DFT
F
• CONJUGATE SYMMETRY• CONVOLUTION
![Page 17: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/17.jpg)
17
7.4 Properties of the One-Dimensional DFT
• THE FAST FOURIER TRANSFORM
2n
![Page 18: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/18.jpg)
18
7.5 The Two-Dimensional DFT
• The 2-D Fourier transform rewrites the original matrix in terms of sums of corrugations
![Page 19: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/19.jpg)
19
7.5.1 Some Properties of the Two-Dimensional Fourier Transform
• SIMILARITY
• THE DFT AS A SPATIAL FILTER
• SEPARABILITY
![Page 20: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/20.jpg)
20
7.5.1 Some Properties of the Two-Dimensional Fourier Transform
• LINEARITY• THE CONVOLUTION THEOREM
Suppose we wish to convolve an image M with a spatial filter S• Pad S with zeroes so that it is the same size as M; denote
this padded result by S’• Form the DFTs of both M and S’ to obtain (M)and (S’)3. Form the element-by-element product of these two
transforms:4. Take the inverse transform of the result:
Put simply, the convolution theorem states or
![Page 21: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/21.jpg)
21
7.5.1 Some Properties of the Two-Dimensional Fourier Transform
• THE DC COEFFICIENT
• SHIFTINGDC coefficientDC coefficient
DC coefficientDC coefficient
![Page 22: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/22.jpg)
22
7.5.1 Some Properties of the Two-Dimensional Fourier Transform
• CONJUGATE SYMMETRY
• DISPLAYING YRANSFORMS
fft, which takes the DFT of a vector,ifft, which takes the inverse DFT of a vector,fft2, which takes the DFT of a matrix,ifft2, which takes the inverse DFT of a matrix, andfftshift, which shifts a transform
![Page 23: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/23.jpg)
23
7.6 Fourier Transforms in MATLAB
e.g.
Note that the DC coefficient is indeed the sum of all the matrix values
![Page 24: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/24.jpg)
24
7.6 Fourier Transforms in MATLAB
e.g.
![Page 25: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/25.jpg)
25
7.6 Fourier Transforms in MATLAB
e.g.
![Page 26: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/26.jpg)
26
7.7 Fourier Transforms of Images
![Page 27: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/27.jpg)
27
FIGURE 7.10
![Page 28: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/28.jpg)
28
FIGURE 7.11
![Page 29: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/29.jpg)
29
FIGURE 7.12
![Page 30: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/30.jpg)
30
FIGURE 7.13• EXAMPLE 7.7.2
![Page 31: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/31.jpg)
31
FIGURE 7.14• EXAMPLE 7.7.3
![Page 32: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/32.jpg)
32
FIGURE 7.15• EXAMPLE 7.7.4
![Page 33: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/33.jpg)
33
7.7 Fourier Transforms of Images
![Page 34: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/34.jpg)
34
7.8 Filtering in the Frequency Domain• Ideal Filtering
LOW-PASS FILTERING
![Page 35: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/35.jpg)
35
FIGURE 7.16
![Page 36: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/36.jpg)
36
FIGURE 7.17
D = 15
![Page 37: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/37.jpg)
37
7.8 Filtering in the Frequency Domain
>> cfl = cf.*b>> cfli = ifft2(cfl);>> figure, fftshow(cfli, ’abs’)
![Page 38: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/38.jpg)
38
FIGURE 7.18D = 5 D = 30
![Page 39: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/39.jpg)
39
7.8 Filtering in the Frequency Domain
HIGH-PASS FILTERING
![Page 40: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/40.jpg)
40
FIGURE 7.19
![Page 41: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/41.jpg)
41
FIGURE 7.20
![Page 42: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/42.jpg)
42
7.8.2 Butterworth Filtering
Ideal filtering simply cuts off the Fourier transform at some distance from the center
It has the disadvantage of introducing unwanted artifacts (ringing) into the result
One way of avoiding these artifacts is to use as a filter matrix, a circle with a cutoff that is less sharp
![Page 43: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/43.jpg)
43
FIGURE 7.21
![Page 44: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/44.jpg)
44
FIGURE 7.22 & 7.23
![Page 45: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/45.jpg)
45
FIGURE 7.24
![Page 46: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/46.jpg)
46
FIGURE 7.25
![Page 47: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/47.jpg)
47
FIGURE 7.26
>> cfbli = ifft2(cfbl);>> figure, fftshow(cfbli, ’abs’)
>> bl = lbutter(c,15,1);>> cfbl = cf.*bl;>> figure, fftshow(cfbl, ’log’);
![Page 48: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/48.jpg)
48
FIGURE 7.27
![Page 49: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/49.jpg)
49
7.8.3 Gaussian Filtering
A wider function, with a large standard deviation, will have a low maximum
![Page 50: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/50.jpg)
50
FIGURE 7.28
![Page 51: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/51.jpg)
51
FIGURE 7.29
![Page 52: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/52.jpg)
52
7.9 Homomorphic Filtering
where f(x, y) is intensity, i(x, y) is the illumination and r(x, y) is the reflectance
![Page 53: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/53.jpg)
53
7.9 Homomorphic Filtering
![Page 54: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/54.jpg)
54
FIGURE 7.32function res=homfilt(im,cutoff,order,lowgain,highgain) % HOMFILT(IMAGE,FILTER) applies homomorphic filtering % to the image IMAGE% with the given parameters u=im2uint8(im/256); u(find(u==0))=1;l=log(double(u));ft=fftshift(fft2(l));f=hb_butter(im,cutoff,order,lowgain,highgain);b=f.*ft;ib=abs(ifft2(b));res=exp(ib);
![Page 55: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/55.jpg)
55
FIGURE 7.33>>i=imread(‘newborn.tif’);
>>r=[1:256]’*ones(1,256);
>>x=double(i).*(0.5+0.4*sin((r-32)/16));
>>imshow(i);figure;imshow(x/256);
![Page 56: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/56.jpg)
56
FIGURE 7.34>>xh=homfilt(x,10,2,0.5,2);
>>imshow(xh/16);
![Page 57: Chapter 7: The Fourier Transform 7.1 Introduction](https://reader036.fdocuments.in/reader036/viewer/2022081419/56814e4a550346895dbbcf2d/html5/thumbnails/57.jpg)
57
FIGURE 7.35>> a=imread('arch.tif');>> figure;imshow(a);>> a1=a(:,:,1);>> figure;imshow(a1);
>> a2=double(a1);>> ah=homfilt(a2,128,2,0.5,2);>> figure;imshow(ah/14);