Download presentation
Presentation is loading. Please wait.
Published byBernadette Ellis Modified over 8 years ago
1
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng Chapter 7: The Fourier Transform
2
2 © 2010 Cengage Learning Engineering. All Rights Reserved. 7.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 Ch7-p.145
3
3 7.2 Background © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.145
4
4 FIGURE 7.2 © 2010 Cengage Learning Engineering. All Rights Reserved. A periodic function may be written as the sum of sines and cosines of varying amplitudes and frequencies Ch7-p.146
5
5 7.2 Background © 2010 Cengage Learning Engineering. All Rights Reserved. These are the equations for the Fourier series expansion of f (x), and they can be expressed in complex form Ch7-p.147
6
6 7.2 Background © 2010 Cengage Learning Engineering. All Rights Reserved. If the function is nonperiodic, we can obtain similar results by letting T → ∞, in which case Ch7-p.147
7
7 7.2 Background © 2010 Cengage Learning Engineering. All Rights Reserved. Fourier transform pair Further details can be found, for example, in James [18]. Ch7-p.148
8
8 7.3 The One-Dimensional Discrete Fourier Transform © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.148
9
9 7.3 The One-Dimensional Discrete Fourier Transform © 2010 Cengage Learning Engineering. All Rights Reserved. Definition of the One-Dimensional DFT Ch7-p.148
10
10 7.3 The One-Dimensional Discrete Fourier Transform © 2010 Cengage Learning Engineering. All Rights Reserved. This definition can be expressed as a matrix multiplication where F is an N × N matrix defined by Given N, we shall define Ch7-p.149
11
11 © 2010 Cengage Learning Engineering. All Rights Reserved. e.g. suppose f = [1, 2, 3, 4] so that N = 4. Then 7.3 The One-Dimensional Discrete Fourier Transform Ch7-p.150
12
12 © 2010 Cengage Learning Engineering. All Rights Reserved. 7.3 The One-Dimensional Discrete Fourier Transform Ch7-p.150
13
13 © 2010 Cengage Learning Engineering. All Rights Reserved. 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 Ch7-p.150
14
14 © 2010 Cengage Learning Engineering. All Rights Reserved. 7.3 The One-Dimensional Discrete Fourier Transform Ch7-p.151
15
15 © 2010 Cengage Learning Engineering. All Rights Reserved. 7.3 The One-Dimensional Discrete Fourier Transform Ch7-p.151
16
16 7.4 Properties of the One-Dimensional DFT © 2010 Cengage Learning Engineering. All Rights Reserved. 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 Ch7-p.152
17
17 7.4 Properties of the One-Dimensional DFT © 2010 Cengage Learning Engineering. All Rights Reserved. SHIFTING Suppose we multiply each element x n 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 Ch7-p.152
18
18 7.4 Properties of the One-Dimensional DFT © 2010 Cengage Learning Engineering. All Rights Reserved. e.g. Ch7-p.152
19
19 7.4 Properties of the One-Dimensional DFT © 2010 Cengage Learning Engineering. All Rights Reserved. Notice that the first four elements of X are the last four elements of X1 and vice versa Ch7-p.153
20
20 SCALING where 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 © 2010 Cengage Learning Engineering. All Rights Reserved. F Ch7-p.153
21
21 7.4 Properties of the One-Dimensional DFT © 2010 Cengage Learning Engineering. All Rights Reserved. CONJUGATE SYMMETRY CONVOLUTION Ch7-p.153
22
22 7.4 Properties of the One-Dimensional DFT © 2010 Cengage Learning Engineering. All Rights Reserved. THE FAST FOURIER TRANSFORM Appendix B Ch7-p.157 2n2n
23
23 7.5 The Two-Dimensional DFT © 2010 Cengage Learning Engineering. All Rights Reserved. The 2-D Fourier transform rewrites the original matrix in terms of sums of corrugations Ch7-p.157
24
24 7.5.1 Some Properties of the Two- Dimensional Fourier Transform © 2010 Cengage Learning Engineering. All Rights Reserved. SIMILARITY THE DFT AS A SPATIAL FILTER SEPARABILITY Ch7-p.159
25
25 7.5.1 Some Properties of the Two- Dimensional Fourier Transform © 2010 Cengage Learning Engineering. All Rights Reserved. LINEARITY THE CONVOLUTION THEOREM Suppose we wish to convolve an image M with a spatial filter S 1.Pad S with zeroes so that it is the same size as M ; denote this padded result by S’ 2.Form the DFTs of both M and S’ to obtain (M) and (S’) Ch7-p.160
26
26 7.5.1 Some Properties of the Two- Dimensional Fourier Transform © 2010 Cengage Learning Engineering. All Rights Reserved. 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 equivalently that Ch7-p.161
27
27 7.5.1 Some Properties of the Two- Dimensional Fourier Transform © 2010 Cengage Learning Engineering. All Rights Reserved. THE DC COEFFICIENT SHIFTING Ch7-p.162 DC coefficient
28
28 7.5.1 Some Properties of the Two- Dimensional Fourier Transform © 2010 Cengage Learning Engineering. All Rights Reserved. CONJUGATE SYMMETRY DISPLAYING YRANSFORMS Ch7-p.163
29
29 7.6 Fourier Transforms in M ATLAB © 2010 Cengage Learning Engineering. All Rights Reserved. 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, and fftshift, which shifts a transform Ch7-p.164
30
30 7.6 Fourier Transforms in M ATLAB © 2010 Cengage Learning Engineering. All Rights Reserved. e.g. Note that the DC coefficient is indeed the sum of all the matrix values Ch7-p.164
31
31 7.6 Fourier Transforms in M ATLAB © 2010 Cengage Learning Engineering. All Rights Reserved. e.g. Ch7-p.165
32
32 7.6 Fourier Transforms in M ATLAB © 2010 Cengage Learning Engineering. All Rights Reserved. e.g. Ch7-p.165
33
33 7.7 Fourier Transforms of Images © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.167
34
34 FIGURE 7.10 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.168
35
35 FIGURE 7.11 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.169
36
36 FIGURE 7.12 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.169
37
37 FIGURE 7.13 © 2010 Cengage Learning Engineering. All Rights Reserved. EXAMPLE 7.7.2 Ch7-p.170
38
38 FIGURE 7.14 © 2010 Cengage Learning Engineering. All Rights Reserved. EXAMPLE 7.7.3 Ch7-p.170
39
39 FIGURE 7.15 © 2010 Cengage Learning Engineering. All Rights Reserved. EXAMPLE 7.7.4 Ch7-p.171
40
40 7.7 Fourier Transforms of Images © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.172
41
41 7.8 Filtering in the Frequency Domain © 2010 Cengage Learning Engineering. All Rights Reserved. Ideal Filtering LOW-PASS FILTERING Ch7-p.172
42
42 FIGURE 7.16 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.173
43
43 FIGURE 7.17 © 2010 Cengage Learning Engineering. All Rights Reserved. D = 15 Ch7-p.174
44
44 7.8 Filtering in the Frequency Domain © 2010 Cengage Learning Engineering. All Rights Reserved. >> cfl = cf.*b >> cfli = ifft2(cfl); >> figure, fftshow(cfli, ’abs’) Ch7-p.174
45
45 FIGURE 7.18 © 2010 Cengage Learning Engineering. All Rights Reserved. D = 5D = 30 Ch7-p.175
46
46 7.8 Filtering in the Frequency Domain © 2010 Cengage Learning Engineering. All Rights Reserved. HIGH-PASS FILTERING Ch7-p.174
47
47 FIGURE 7.19 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.176
48
48 FIGURE 7.20 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.176
49
49 7.8.2 Butterworth Filtering © 2010 Cengage Learning Engineering. All Rights Reserved. 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 Ch7-p.177
50
50 FIGURE 7.21 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.177
51
51 FIGURE 7.22 & 7.23 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.178
52
52 FIGURE 7.24 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.179
53
53 FIGURE 7.25 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.179
54
54 FIGURE 7.26 © 2010 Cengage Learning Engineering. All Rights Reserved. >> cfbli = ifft2(cfbl); >> figure, fftshow(cfbli, ’abs’) >> bl = lbutter(c,15,1); >> cfbl = cf.*bl; >> figure, fftshow(cfbl, ’log’); Ch7-p.180
55
55 FIGURE 7.27 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.181
56
56 7.8.3 Gaussian Filtering © 2010 Cengage Learning Engineering. All Rights Reserved. A wider function, with a large standard deviation, will have a low maximum Ch7-p.181
57
57 FIGURE 7.28 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.182
58
58 FIGURE 7.29 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.183
59
59 7.9 Homomorphic Filtering © 2010 Cengage Learning Engineering. All Rights Reserved. where f(x, y) is intensity, i(x, y) is the illumination and r(x, y) is the reflectance Ch7-p.184
60
60 FIGURE 7.31 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.185
61
61 FIGURE 7.32 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.185
62
62 FIGURE 7.33 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.186
63
63 FIGURE 7.34 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.186
64
64 FIGURE 7.35 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch7-p.187
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.