1 / 72

Digital Image Processing Chapter 4: Image Enhancement in the Frequency Domain 22 June 2005

Digital Image Processing Chapter 4: Image Enhancement in the Frequency Domain 22 June 2005. Background: Fourier Series. Fourier series:. Any periodic signals can be viewed as weighted sum of sinusoidal signals with different frequencies. Frequency Domain: view frequency as an

cleary
Download Presentation

Digital Image Processing Chapter 4: Image Enhancement in the Frequency Domain 22 June 2005

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Digital Image Processing Chapter 4: Image Enhancement in the Frequency Domain 22 June 2005

  2. Background: Fourier Series Fourier series: Anyperiodic signals can be viewed as weighted sum of sinusoidal signals with different frequencies Frequency Domain: view frequency as an independent variable (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  3. Fourier Tr. and Frequency Domain Fourier Tr. Time, spatial Domain Signals Frequency Domain Signals Inv Fourier Tr. 1-D, Continuous case Fourier Tr.: Inv. Fourier Tr.:

  4. Fourier Tr. and Frequency Domain (cont.) 1-D, Discrete case Fourier Tr.: u = 0,…,M-1 Inv. Fourier Tr.: x = 0,…,M-1 F(u) can be written as or where

  5. Example of 1-D Fourier Transforms Notice that the longer the time domain signal, The shorter its Fourier transform (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  6. Relation Between Dx and Du For a signal f(x) withMpoints, let spatial resolution Dx be space between samples in f(x) and let frequency resolutionDu be space between frequencies components in F(u), we have Example: for a signal f(x) with sampling period 0.5 sec, 100 point, we will get frequency resolution equal to This means that in F(u) we can distinguish 2 frequencies that are apart by 0.02 Hertz or more.

  7. 2-Dimensional Discrete Fourier Transform For an image of size MxN pixels 2-D DFT u = frequency in x direction, u = 0 ,…, M-1 v = frequency in y direction, v = 0 ,…, N-1 2-D IDFT x = 0 ,…, M-1 y = 0 ,…, N-1

  8. 2-Dimensional Discrete Fourier Transform (cont.) F(u,v) can be written as or where For the purpose of viewing, we usually display only the Magnitude part ofF(u,v)

  9. 2-D DFT Properties (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  10. 2-D DFT Properties (cont.) (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  11. 2-D DFT Properties (cont.) (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  12. 2-D DFT Properties (cont.) (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  13. Computational Advantage of FFT Compared to DFT (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  14. Relation Between Spatial and Frequency Resolutions where Dx = spatial resolution in x direction Dy = spatial resolution in y direction Du = frequency resolution in x direction Dv = frequency resolution in y direction N,M = image width and height ( Dxand Dyare pixel width and height.)

  15. f(x,y) How to Perform 2-D DFT by Using 1-D DFT 1-D DFT by row F(u,y) 1-D DFT by column F(u,v)

  16. f(x,y) How to Perform 2-D DFT by Using 1-D DFT (cont.) Alternative method 1-D DFT by column 1-D DFT by row F(x,v) F(u,v)

  17. Periodicity of 1-D DFT From DFT: -N 2N N 0 We display only in this range DFT repeats itself every N points (Period = N) but we usually display it for n = 0 ,…, N-1

  18. Conventional Display for 1-D DFT f(x) DFT N-1 N-1 0 0 Time Domain Signal High frequency area Low frequency area The graph F(u) is not easy to understand !

  19. Conventional Display for DFT : FFT Shift FFT Shift: Shift center of the graph F(u) to 0 to get better Display which is easier to understand. N-1 0 High frequency area Low frequency area -N/2 N/2-1 0

  20. Periodicity of 2-D DFT g(x,y) 2-D DFT: -M For an image of size NxM pixels, its 2-D DFT repeats itself every N points in x-direction and every M points in y-direction. 0 M We display only in this range 2M -N 0 N 2N (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  21. Conventional Display for 2-D DFT F(u,v) has low frequency areas at corners of the image while high frequency areas are at the center of the image which is inconvenient to interpret. High frequency area Low frequency area (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  22. 2-D FFT Shift : Better Display of 2-D DFT 2-D FFT Shift is a MATLAB function: Shift the zero frequency of F(u,v) to the center of an image. 2D FFTSHIFT High frequency area Low frequency area (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  23. 2-D FFT Shift (cont.) : How it works -M 0 Display of 2D DFT After FFT Shift M Original display of 2D DFT 2M -N 0 N 2N (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  24. Example of 2-D DFT Notice that the longer the time domain signal, The shorter its Fourier transform (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  25. Example of 2-D DFT Notice that direction of an object in spatial image and Its Fourier transform are orthogonal to each other. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  26. Example of 2-D DFT 2D DFT Original image 2D FFT Shift

  27. Example of 2-D DFT 2D DFT Original image 2D FFT Shift

  28. Basic Concept of Filtering in the Frequency Domain From Fourier Transform Property: We cam perform filtering process by using Multiplication in the frequency domain is easier than convolution in the spatial Domain. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  29. Filtering in the Frequency Domain with FFT shift F(u,v) H(u,v) (User defined) g(x,y) FFT shift X 2D IFFT 2D FFT FFT shift f(x,y) G(u,v) In this case, F(u,v) and H(u,v) must have the same size and have the zero frequency at the center.

  30. Multiplication in Freq. Domain = Circular Convolution f(x) DFT F(u) G(u) = F(u)H(u) IDFT g(x) h(x) DFT H(u) Multiplication of DFTs of 2 signals is equivalent to perform circular convolution in the spatial domain. f(x) h(x) “Wrap around” effect g(x)

  31. Multiplication in Freq. Domain = Circular Convolution Original image H(u,v) Gaussian Lowpass Filter with D0 = 5 Filtered image (obtained using circular convolution) Incorrect areas at image rims

  32. Linear Convolution by using Circular Convolution and Zero Padding f(x) Zero padding DFT F(u) G(u) = F(u)H(u) h(x) Zero padding DFT H(u) IDFT Concatenation g(x) Padding zeros Before DFT Keep only this part

  33. Linear Convolution by using Circular Convolution and Zero Padding (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  34. Linear Convolution by using Circular Convolution and Zero Padding Filtered image Zero padding area in the spatial Domain of the mask image (the ideal lowpass filter) Only this area is kept. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  35. Filtering in the Frequency Domain : Example In this example, we set F(0,0) to zero which means that the zero frequency component is removed. Note: Zero frequency = average intensity of an image (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  36. Filtering in the Frequency Domain : Example Lowpass Filter Highpass Filter (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  37. Filtering in the Frequency Domain : Example (cont.) Result of Sharpening Filter (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  38. Filter Masks and Their Fourier Transforms (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  39. Ideal Lowpass Filter Ideal LPF Filter Transfer function where D(u,v) = Distance from (u,v) to the center of the mask. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  40. Examples of Ideal Lowpass Filters (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition. The smaller D0, the more high frequency components are removed.

  41. Results of Ideal Lowpass Filters Ringing effect can be obviously seen! (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  42. How ringing effect happens Surface Plot Ideal Lowpass Filter with D0= 5 Abrupt change in the amplitude

  43. How ringing effect happens (cont.) Surface Plot Spatial Response of Ideal Lowpass Filter with D0= 5 Ripples that cause ringing effect

  44. How ringing effect happens (cont.) (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  45. Butterworth Lowpass Filter Transfer function Where D0= Cut off frequency, N = filter order. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  46. Results of Butterworth Lowpass Filters There is less ringing effect compared to those of ideal lowpass filters! (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  47. Spatial Masks of the Butterworth Lowpass Filters Some ripples can be seen. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

  48. Gaussian Lowpass Filter Transfer function Where D0= spread factor. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition. Note: the Gaussian filter is the only filter that has no ripple and hence no ringing effect.

  49. Gaussian Lowpass Filter (cont.) Gaussian lowpass filter with D0= 5 Spatial respones of the Gaussian lowpass filter with D0= 5 Gaussian shape

  50. Results of Gaussian Lowpass Filters No ringing effect! (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.

More Related