560 likes | 1.08k Views
Fourier Transform and Image Filtering in the Frequency Domain. Digital Image Processing. Bundit Thipakorn, Ph.D. Computer Engineering Department. Image Transforms. Used of Image Transforms:.
E N D
Fourier Transform and Image Filtering in the Frequency Domain Digital Image Processing Bundit Thipakorn, Ph.D. Computer Engineering Department
Image Transforms Used of Image Transforms: To reorder or rearrange the information in the image in such the way that the information is easier to perform by the image processing operations.
Image Transforms Image Processing Process Forward Transform Inverse Transform The common steps of using the image transforms in the image processing process. Image f(x,y) Processed Image f’(x,y)
Image Transforms T(u,v) = A Generic Image Transform Equation: where f(x,y) is the input N x N image T(u,v) are the transform coefficients and B(x,y; u,v) is a set of basis images.
Image Transforms f(x,y) = A Generic Inverse Transform Equation: where f(x,y) is the input N x N image T(u,v) are the transform coefficients and B-1 (x,y; u,v) is a set of inverse basis images.
Similarity Index: T(u,v) A high value of T(u,v) f(x,y) and B(x,y; u,v) are alike. A low value of T(u,v) f(x,y) and B(x,y; u,v) are difference.
F(u,v) = f(x,y) = Fourier Transform Definition: Forward Fourier Transform Inverse Fourier Transform
is a set of basis images. is a set of inverse basis images. Fourier Transform where f(x,y) is the input N x N image F(u,v) are the Fourier transform coefficients By Euler's identity: - j =
Fourier Transform i.e. decompose an image into its sine and cosine components. the transformed image is represented as a set of spatialfrequencies|F(u,v)|.
Fourier Transform The frequency of the sinusoidal is given by the distance of the point (u,v) from the origin: and the orientation is given by:
Frequency = how rapidly the signal is changing in space. Fourier Transform Frequency = 1 Frequency = 4 Frequency = 0
Examples: Frequency Domain Spatial Domain
Examples: Frequency Domain Spatial Domain
Examples: Frequency Domain Spatial Domain
Examples: A Nature Image A Man-Made Image Spatial Domain Frequency Domain
Examples: The Man-Made Texture Images Spatial Domain Frequency Domain
Fourier Transform The Important Observations: • |F(0,0)| of most images is the highest. • The Fourier transform exhibits the coherent structures reflected some structures in the original image as lines or spokes passing through the origin.
Fourier Transform The Important Observations: • The Fourier transform of the natural scenes tend to contain no coherent structures. • The coherence of the texture in the original image and the structures in the Fourier image is obviously clear. KMUTT
PT = Fourier Transform Power Spectrum: P(u,v) P(u,v) = |F(u,v)|2 Total Power: PT The image power is concentrated in the low frequency components.
8 95 16 97 32 98 64 99.4 128 99.8 Fourier Transform Radius (pixels) % image power KMUTT
F(u,v) = F(x,v) = Fourier Transform Properties Some Properties: ► Separability where
Fourier Transform Properties ► Translation F(u-u0, v-v0) f(x-x0, y-y0)
Fourier Transform Properties ► Periodicity and Conjugate Symmetry F(u,v) = F(u+N, v) = F(u, v+N) = F(u+N, v+N) If f(x,y) is real, |F(u,v)| = F*(-u, -v) or |F(u,v)| = |F(-u, -v)|
Fourier Transform Properties ► Distributivity and Scaling F[f1(x,y) + f2(x,y)] = F[f1(x,y)] + F[f2(x,y)] af(x,y) aF(u,v) f(ax,by)
Fourier Transform Properties ► Convolution f(x,y)*g(x,y) F(u,v)G(u,v) f(x,y)g(x,y) F(u,v)*G(u,v) ► Correlation F*(u,v)G(u,v) f*(x,y)g(x,y)
C(u,v) = f(x,y) = Discrete Cosine Transform (DCT) Definition: Forward DCT Transform Inverse DCT Transform
DCT Definition where Fourier V.S. DCT DCT coefficients C(u,v) Real numbers Complex numbers. Fourier transform coefficients F(u,v)
Walsh and Hadamard Transform Basis Function Fourier and DCT Transforms Sinusoidal Wave Walsh and Hadamard Transforms Square Wave
Walsh Transform Definition: Forward Walsh Transform W(u,v) = Inverse Walsh Transform f(x,y) = KMUTT
g(x,y;u,v) = Walsh Transform Cont’d. where bk(z) is the kth bit in the binary representation of z. The set of basic functions g(x,y;u,v) of Walsh transform is defined as following: i.e. the value of g(x,y;u,v) will be either +1 or -1.
Walsh Transform Cont’d. Thus Walsh’s basis functions Square waves where the width of pulse may vary. = Note: g(x,y;u,v) is called “sequency component”.
Hadamard Transform Definition: Forward Hadamard Transform H(u,v) = Inverse Hadamard Transform f(x,y) =
Hadamard Transform Cont’d. where bk(z) is the kth bit in the binary representation of z. The set of basic functions g(x,y;u,v) of Hadamard transform is defined as following: g(x,y;u,v) = i.e. the value of g(x,y;u,v) will be either +1 or -1.
Hadamard Transform Cont’d. The Hadamard transform is a symmetric, separable unitary transformation. It exists for N = 2n (n = integer). The Hadamard matrix of lowest order (N=2) is: and for successively larger 2N, these can be generated recursively by the expression:
Hadamard Transform Cont’d. Ex: The Hadamard matrices of order four and eight are:
0 7 3 4 1 6 2 5 Hadamard Transform Cont’d. Number of Sign Changes Where + and - indicate +1 and -1, respectively.
0 1 2 3 4 5 6 7 Hadamard Transform Cont’d. The ordered Hadamard transform Number of Sign Changes Where + and - indicate +1 and -1, respectively.
Inverse DFT DFT X Image Filtering in Frequency Domain Image f(x,y) F(u,v) F(u,v)H(u,v) Filter H(u,v) Processed Image f’(x,y)
Image Filtering Cont’d. The basic “model” for filtering in the frequency domain is expressed as: where F(u,v) is the Fourier transform of the input image to be filtered, F’(u,v) is the Fourier transform of the enhanced image, H(u,v) is the Frequency response of the filter.
Select H(u,v) that yields F’(u,v) Image Filtering Cont’d. Objective: Basics of filtering in the frequency domain: 1. Multiply the input image by (-1)x+y to center the transform. 2. Determine H(u,v) and Compute F(u,v).
Image Filtering Cont’d. 3. Multiply F(u,v) with H(u,v). 4. Compute the inverse Fourier transform of the result in (3). 5. Obtain the real part of the result in (4). 6. Multiply the result in (5) by (-1)x+y.
Image Filtering Cont’d. Lowpass Filter H(u,v) = 1 if u2 + v2 < r2 H(u,v) = 0 if u2 + v2≥ r2
Image Filtering Cont’d. Highpass Filter H(u,v) = 0 if u2 + v2 < r2 H(u,v) = 1 if u2 + v2≥ r2
Image Filtering Cont’d. Band Pass Filter H(u,v) = 1 if a2≤ u2 + v2≥ b2 H(u,v) = 0 otherwise