Download presentation
Presentation is loading. Please wait.
Published byAngel Eaton Modified over 9 years ago
1
University of Ioannina - Department of Computer Science Filtering in the Frequency Domain (Application) Digital Image Processing Christophoros Nikou cnikou@cs.uoi.gr
2
2 C. Nikou – Digital Image Processing (E12) DFT & Images The DFT of a two dimensional image can be visualised by showing the spectrum of the image component frequencies Images taken from Gonzalez & Woods, Digital Image Processing (2002) DFT
3
3 C. Nikou – Digital Image Processing (E12) DFT & Images Images taken from Gonzalez & Woods, Digital Image Processing (2002)
4
4 C. Nikou – Digital Image Processing (E12) DFT & Images Images taken from Gonzalez & Woods, Digital Image Processing (2002)
5
5 C. Nikou – Digital Image Processing (E12) DFT & Images (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002) DFT Scanning electron microscope image of an integrated circuit magnified ~2500 times Fourier spectrum of the image
6
6 C. Nikou – Digital Image Processing (E12) DFT & Images (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)
7
7 C. Nikou – Digital Image Processing (E12) DFT & Images (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)
8
8 C. Nikou – Digital Image Processing (E12) Periodicity of the DFT The range of frequencies of the signal is between [-M/2, M/2]. The DFT covers two back-to-back half periods of the signal as it covers [0, M-1].
9
9 C. Nikou – Digital Image Processing (E12) Periodicity of the DFT (cont...) For display and computation purposes it is convenient to shift the DFT and have a complete period in [0, M-1]. From DFT properties: Letting N 0 =M/2 : And F(0) is now located at M/2.
10
10 C. Nikou – Digital Image Processing (E12) Periodicity of the DFT (cont...) In two dimensions: and F(0,0) is now located at ( M/2, N/2).
11
11 C. Nikou – Digital Image Processing (E12) Periodicity of the DFT (cont...)
12
12 C. Nikou – Digital Image Processing (E12) DFT & Images (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)
13
13 C. Nikou – Digital Image Processing (E12) DFT & Images (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)
14
14 C. Nikou – Digital Image Processing (E12) DFT & Images (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002) Although the images differ by a simple geometric transformation no intuitive information may be extracted from their phases regarding their relation.
15
15 C. Nikou – Digital Image Processing (E12) DFT & Images (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)
16
16 C. Nikou – Digital Image Processing (E12) The DFT and Image Processing To filter an image in the frequency domain: 1.Compute F(u,v) the DFT of the image 2.Multiply F(u,v) by a filter function H(u,v) 3.Compute the inverse DFT of the result Images taken from Gonzalez & Woods, Digital Image Processing (2002)
17
17 C. Nikou – Digital Image Processing (E12) The importance of zero padding Images taken from Gonzalez & Woods, Digital Image Processing (2002)
18
18 C. Nikou – Digital Image Processing (E12) The importance of zero padding (cont...) Images taken from Gonzalez & Woods, Digital Image Processing (2002)
19
19 C. Nikou – Digital Image Processing (E12) The importance of zero padding (cont...) Images taken from Gonzalez & Woods, Digital Image Processing (2002)
20
20 C. Nikou – Digital Image Processing (E12) Some Basic Frequency Domain Filters Images taken from Gonzalez & Woods, Digital Image Processing (2002) Low Pass Filter High Pass Filter
21
21 C. Nikou – Digital Image Processing (E12) Some Basic Frequency Domain Filters Images taken from Gonzalez & Woods, Digital Image Processing (2002)
22
22 C. Nikou – Digital Image Processing (E12) Some Basic Frequency Domain Filters Images taken from Gonzalez & Woods, Digital Image Processing (2002)
23
23 C. Nikou – Digital Image Processing (E12) Smoothing Frequency Domain Filters Smoothing is achieved in the frequency domain by dropping out the high frequency components The basic model for filtering is: G(u,v) = H(u,v)F(u,v) where F(u,v) is the Fourier transform of the image being filtered and H(u,v) is the filter transform function Low pass filters – only pass the low frequencies, drop the high ones.
24
24 C. Nikou – Digital Image Processing (E12) Ideal Low Pass Filter Simply cut off all high frequency components that are a specified distance D 0 from the origin of the transform. Changing the distance changes the behaviour of the filter. Images taken from Gonzalez & Woods, Digital Image Processing (2002)
25
25 C. Nikou – Digital Image Processing (E12) Ideal Low Pass Filter (cont…) The transfer function for the ideal low pass filter can be given as: where D(u,v) is given as:
26
26 C. Nikou – Digital Image Processing (E12) Ideal Low Pass Filter (cont…) An image, its Fourier spectrum and a series of ideal low pass filters of radius 5, 15, 30, 80 and 230 superimposed on top of it. Images taken from Gonzalez & Woods, Digital Image Processing (2002)
27
27 C. Nikou – Digital Image Processing (E12) Ideal Lowpass Filters (cont...) ILPF in the spatial domain is a sinc function that has to be truncated and produces ringing effects. The main lobe is responsible for blurring and the side lobes are responsible for ringing. Images taken from Gonzalez & Woods, Digital Image Processing (2002)
28
28 C. Nikou – Digital Image Processing (E12) Ideal Low Pass Filter (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002) Original image ILPF of radius 5 ILPF of radius 30 ILPF of radius 230 ILPF of radius 80 ILPF of radius 15
29
29 C. Nikou – Digital Image Processing (E12) Butterworth Lowpass Filters The transfer function of a Butterworth lowpass filter of order n with cutoff frequency at distance D 0 from the origin is defined as: Images taken from Gonzalez & Woods, Digital Image Processing (2002)
30
30 C. Nikou – Digital Image Processing (E12) Butterworth Lowpass Filters (cont...) Images taken from Gonzalez & Woods, Digital Image Processing (2002)
31
31 C. Nikou – Digital Image Processing (E12) Butterworth Lowpass Filter (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002) Original image BLPF n=2, D 0 =5 BLPF n=2, D 0 =30 BLPF n=2, D 0 =230 BLPF n=2, D 0 =80 BLPF n=2, D 0 =15 Less ringing than ILPF due to smoother transition
32
32 C. Nikou – Digital Image Processing (E12) Gaussian Lowpass Filters The transfer function of a Gaussian lowpass filter is defined as: Images taken from Gonzalez & Woods, Digital Image Processing (2002)
33
33 C. Nikou – Digital Image Processing (E12) Gaussian Lowpass Filters (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002) Original image Gaussian D 0 =5 Gaussian D 0 =30 Gaussian D 0 =230 Gaussian D 0 =85 Gaussian D 0 =15 Less ringing than BLPF but also less smoothing
34
34 C. Nikou – Digital Image Processing (E12) Lowpass Filters Compared ILPF D 0 =15 BLPF n=2, D 0 =15 Gaussian D 0 =15 Images taken from Gonzalez & Woods, Digital Image Processing (2002)
35
35 C. Nikou – Digital Image Processing (E12) Lowpass Filtering Examples A low pass Gaussian filter is used to connect broken text Images taken from Gonzalez & Woods, Digital Image Processing (2002)
36
36 C. Nikou – Digital Image Processing (E12) Lowpass Filtering Examples Images taken from Gonzalez & Woods, Digital Image Processing (2002)
37
37 C. Nikou – Digital Image Processing (E12) Lowpass Filtering Examples (cont…) Different lowpass Gaussian filters used to remove blemishes in a photograph. Images taken from Gonzalez & Woods, Digital Image Processing (2002)
38
38 C. Nikou – Digital Image Processing (E12) Lowpass Filtering Examples (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002)
39
39 C. Nikou – Digital Image Processing (E12) Sharpening in the Frequency Domain Edges and fine detail in images are associated with high frequency components High pass filters – only pass the high frequencies, drop the low ones High pass frequencies are precisely the reverse of low pass filters, so: H hp (u, v) = 1 – H lp (u, v)
40
40 C. Nikou – Digital Image Processing (E12) Ideal High Pass Filters The ideal high pass filter is given by: D 0 is the cut off distance as before. Images taken from Gonzalez & Woods, Digital Image Processing (2002)
41
41 C. Nikou – Digital Image Processing (E12) Ideal High Pass Filters (cont…) IHPF D 0 = 15IHPF D 0 = 30IHPF D 0 = 80 Images taken from Gonzalez & Woods, Digital Image Processing (2002)
42
42 C. Nikou – Digital Image Processing (E12) Butterworth High Pass Filters The Butterworth high pass filter is given as: n is the order and D 0 is the cut off distance as before. Images taken from Gonzalez & Woods, Digital Image Processing (2002)
43
43 C. Nikou – Digital Image Processing (E12) Butterworth High Pass Filters (cont…) BHPF n=2, D 0 =15 Images taken from Gonzalez & Woods, Digital Image Processing (2002) BHPF n=2, D 0 =30 BHPF n=2, D 0 =80
44
44 C. Nikou – Digital Image Processing (E12) Gaussian High Pass Filters The Gaussian high pass filter is given as: D 0 is the cut off distance as before. Images taken from Gonzalez & Woods, Digital Image Processing (2002)
45
45 C. Nikou – Digital Image Processing (E12) Gaussian High Pass Filters (cont…) Images taken from Gonzalez & Woods, Digital Image Processing (2002) Gaussian HPF n=2, D 0 =15 Gaussian HPF n=2, D 0 =30 Gaussian HPF n=2, D 0 =80
46
46 C. Nikou – Digital Image Processing (E12) Highpass Filter Comparison IHPF D 0 = 15 Images taken from Gonzalez & Woods, Digital Image Processing (2002) Gaussian HPF n=2, D 0 =15 BHPF n=2, D 0 =15
47
47 C. Nikou – Digital Image Processing (E12) Highpass Filtering Example Original image Highpass filtering result High frequency emphasis result After histogram equalisation Images taken from Gonzalez & Woods, Digital Image Processing (2002)
48
48 C. Nikou – Digital Image Processing (E12) Laplacian In The Frequency Domain Laplacian in the frequency domain (not centered) 2-D image of Laplacian in the frequency domain (not centered) Inverse DFT of Laplacian in the frequency domain Zoomed section of the image on the left compared to spatial filter Images taken from Gonzalez & Woods, Digital Image Processing (2002)
49
49 C. Nikou – Digital Image Processing (E12) Frequency Domain Laplacian Example Original image Laplacian filtered image Laplacian image scaled Enhanced image
50
50 C. Nikou – Digital Image Processing (E12) Band-pass and Band-stop Filters
51
51 C. Nikou – Digital Image Processing (E12) Band-Pass Filters (cont...)
52
52 C. Nikou – Digital Image Processing (E12) Band-Pass Filters (cont...)
53
53 C. Nikou – Digital Image Processing (E12) Fast Fourier Transform The reason that Fourier based techniques have become so popular is the development of the Fast Fourier Transform (FFT) algorithm. It allows the Fourier transform to be carried out in a reasonable amount of time. Reduces the complexity from O(N 4 ) to O(N 2 logN 2 ).
54
54 C. Nikou – Digital Image Processing (E12) Frequency Domain Filtering & Spatial Domain Filtering Similar jobs can be done in the spatial and frequency domains. Filtering in the spatial domain can be easier to understand. Filtering in the frequency domain can be much faster – especially for large images.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.