Fourier Transforms and the Frequency Domain Lecture 11 Magnus Gedda magnus.gedda@cb.uu.se Centre for Image Analysis Uppsala University Computer Assisted Image Analysis 04/27/2006 Gedda (Uppsala University) Fourier Transforms Image Analysis 1 / 18
Reading Instructions and Assignment Chapters and Assignment for This Lecture Chapters 4.3 4.6 in Gonzales-Woods. There is no assignment for this lecture. Gedda (Uppsala University) Fourier Transforms Image Analysis 2 / 18
Ideal Lowpass Filters and Ringing In the frequency domain, define a cut-off radius D 0. Ideal Lowpass Filter (ILPF) { 1 if D (u, v) D0 ; H (u, v) = 0 if D (u, v) > D 0. To find h(x, y): 1 Centering: H(u, v) ( 1) u+v 2 Inverse Fourier transform (FT) 3 Multiply real part by ( 1) x+y Gedda (Uppsala University) Fourier Transforms Image Analysis 3 / 18
Ideal Lowpass Filters and Ringing Properties of h(x, y): 1 It has a central dominant circular component (providing the blurring) 2 It has concentric circular components (rings) giving rise to the ringing effect. Example of h(x) from the inverse FT of a disc (ILPF) with radius 5. Gedda (Uppsala University) Fourier Transforms Image Analysis 4 / 18
Ideal Lowpass Filters and Ringing Original image (top left) and filtered images with ILPF of radius 5, 15 and 30, removing 8, 5.4 and 3.6% of the total power. This type of artefacts are not acceptable in e.g. medical imaging. Gedda (Uppsala University) Fourier Transforms Image Analysis 5 / 18
Reduce Ringing with Non-Ideal Lowpass Filters Butterworth Lowpass Filter (BLPF) H (u, v) = 1 + 1 ( ) 2n D(u,v) D 0 n is the order of the filter A high n will cause ringing (approaching ILPF) No sharp discontinuity Gedda (Uppsala University) Fourier Transforms Image Analysis 6 / 18
Butterworth Lowpass Filter BLPF ringing effects for different values of n. In general, BLPFs of order 2 are a good compromise between effective lowpass filtering and acceptable ringing characteristics. Gedda (Uppsala University) Fourier Transforms Image Analysis 7 / 18
Gaussian Lowpass Filter Gaussian Lowpass Filter (GLPF) D 2 (u,v) 2D H (u, v) = e 0 2 D 0 is the standard deviation (σ), or the spread of the Gaussian. The inverse FT of a Gaussian is also a Gaussian, meaning a Gaussian smoothing in the spatial domain. Guarantees no ringing. Gedda (Uppsala University) Fourier Transforms Image Analysis 8 / 18
Highpass Filters Ideal Highpass Filter (IHPF) { 0 if D (u, v) D0 ; H (u, v) = 1 if D (u, v) > D 0. Butterworth Highpass Filter (BHPF) H (u, v) = Gaussian Highpass Filter (GHPF) 1 1 + ( D0 D(u,v) ) 2n D 2 (u,v) 2D H (u, v) = 1 e 0 2 Same ringing effect as for the lowpass filters. Gedda (Uppsala University) Fourier Transforms Image Analysis 9 / 18
Highpass Filters Spatial representation of different highpass filters (ideal, Butterworth and Gaussian). Ringing effect noticable in ideal and Butterworth filters. Gedda (Uppsala University) Fourier Transforms Image Analysis 10 / 18
Unsharp Masking, High-Boost Filtering and High-Freq Emphasis Unsharp Masking High-Boost Filtering (general) f HP (x, y) = f (x, y) f LP (x, y) f HB (x, y) = (A 1) f (x, y) + f HP (x, y) where A 1 H HB (u, v) = (A 1) + H HP (u, v) High-Frequency Emphasis H HFE (u, v) = a + b H HP (u, v) Gedda (Uppsala University) Fourier Transforms Image Analysis 11 / 18
High-Boost Filtering Result of high-boost filtering (original, highpass, A = 2 and A = 2.7). Gedda (Uppsala University) Fourier Transforms Image Analysis 12 / 18
High-Frequency Emphasis Filtering Result of high-frequency emphasis filtering (original, highpass, high-freq emphasis and histogram equalization). Gedda (Uppsala University) Fourier Transforms Image Analysis 13 / 18
Periodicity and Padding Consider image of size M N. Periodicity: F(u, v) = F(u + M, v) = F (u, v + N) = F (u + M, v + N) Symmetry: F(u, v) = F ( u, v) Gedda (Uppsala University) Fourier Transforms Image Analysis 14 / 18
Padding in the Spatial Domain (SD) Padding When introducing identical periods at convolution to avoid wrap-around error. Gedda (Uppsala University) Fourier Transforms Image Analysis 15 / 18
Padding in the Frequency Domain (FD) Padding is important in the frequency domain as well. Convolution in SD is multiplication in FD. The filter and the image must have the same size at multiplication! The padding is removed after the filtering. When padding, the image borders (if not black) become sharp edges, leading to ringing at the image borders after filtering using ideal filters. Gedda (Uppsala University) Fourier Transforms Image Analysis 16 / 18
Correlation Correlation Function f (x, y) h (x, y) = 1 MN M 1 N 1 m=0 n=0 f (m, n) h (x + m, y + n) f is the complex conjugate of f (for images f = f ). Positive summation; h not mirrored about origin. Correlation Theorem f (x, y) h (x, y) F (u, v) H (u, v) f (x, y) h (x, y) F (u, v) H (u, v) Gedda (Uppsala University) Fourier Transforms Image Analysis 17 / 18
Correlation There is a strong similarity between convolution and correlation. Gedda (Uppsala University) Fourier Transforms Image Analysis 18 / 18