1 / 73

Methods for Digital Image Processing

Methods for Digital Image Processing. Basic ideas of Image Transforms. Spatial Frequency or Fourier Transform. Jean Baptiste Joseph Fourier. Why are Spatial Frequencies important?. Efficient data representation Provides a means for modeling and removing noise

larya
Download Presentation

Methods for Digital Image Processing

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. Methods for Digital Image Processing

  2. Basic ideas of Image Transforms

  3. Spatial FrequencyorFourier Transform Jean Baptiste Joseph Fourier

  4. Why are Spatial Frequencies important? • Efficient data representation • Provides a means for modeling and removing noise • Physical processes are often best described in “frequency domain” • Provides a powerful means of image analysis

  5. What is spatial frequency? • Instead of describing a function (i.e., a shape) by a series of positions • It is described by a series of cosines

  6. What is spatial frequency? g(x) = A cos(x) g(x) 2 A x

  7. What is spatial frequency? A cos(x  2/L) g(x) = A cos(x  2/) A cos(x  2f) g(x) Period (L) Wavelength () Frequency f=(1/ ) Amplitude (A) Magnitude (A) x

  8. What is spatial frequency? g(x) = A cos(x  2f) g(x) A x (1/f) period

  9. But what if cosine is shifted in phase? g(x) = A cos(x  2f + ) g(x) x 

  10. What is spatial frequency? Let us take arbitrary g(x) x g(x) 0.00 2 cos(0.25) = 0.707106... 0.25 2 cos(0.50) = 0.0 0.50 2 cos(0.75) = -0.707106... 0.75 2 cos(1.00) = -1.0 1.00 2 cos(1.25) = -0.707106… 1.25 2 cos(1.50) = 0 1.50 2 cos(1.75) = 0.707106... 1.75 2 cos(2.00) = 1.0 2.00 2 cos(2.25) = 0.707106... g(x) = A cos(x  2f + ) A=2 m f = 0.5 m-1 = 0.25 = 45 g(x) = 2 cos(x  2(0.5) + 0.25) 2 cos(x  + 0.25) We calculate discrete values of g(x) for various values of x We substitute values of A, f and 

  11. What is spatial frequency? g(x) = A cos(x  2f + ) g(x) We calculate discrete values of g(x) for various values of x x

  12. Now we take discrete values of Ai , fi and i gi(x) = Ai cos(x  2fi + i), i = 0,1,2,3,... x

  13. Now we substitute fi = i/N 0 N gi(x) = Ai cos(x  2fi + i), i = 0,1,2,3,... gi(x) = Ai cos(x  2i/N+ i), i = 0,1,2,3,…,N-1 f=i/N N = time interval

  14. Values for various values of i 0 N gi(x) = Ai cos(x  2i/N+ i), i = 0,1,2,3,…,N-1 f=i/N We calculate values of function for various values of i

  15. Substituting various values of i to the formula we get various cosinusoides gi(x) = Ai cos(x  2i/N+ i), i = 0,1,2,3,…,N-1 A2 A1 A0 i=1 i=2 i=0

  16. Changing N to N/2 gi(x) = Ai cos(x  2i/N+ i), i = 0,1,2,3,…,N/2 - 1 If N equals the number of pixel in a line, then... i=0 i=N/2 - 1 Lowest frequency Highest frequency

  17. What is spatial frequency? gi(x) = Ai cos(x  2i/N+ i), i = 0,1,2,3,…,N/2-1 If N equals the number of pixels in a line, then... i=0 i=N/2-1 Lowest frequency Highest frequency

  18. What will happen if we take N/2? gi(x) = Ai cos(x  2i/N+ i), i = 0,1,2,3,…,N/2-1 If N equals the number of pixel in a line, then... i=0 i=N/2 Lowest frequency Too high Redundant frequency

  19. What is spatial frequency? g(x) = A cos(x  2f + ) gi(x) = Ai cos(x  2i/N+ i), i = 0,1,2,3,…,N/2-1

  20. We try to approximate a periodic function with standard trivial (orthogonal, base) functions Low frequency + Medium frequency = + High frequency

  21. We add values from component functions point by point + = +

  22. g(x) i=1 i=2 i=3 i=4 i=5 i=63 x 0 127 Example of periodic function created by summing standard trivial functions

  23. g(x) i=1 i=2 i=3 i=4 i=5 i=10 x 0 127 Example of periodic function created by summing standard trivial functions

  24. 64 terms g(x) 10 terms g(x) Example of periodic function created by summing standard trivial functions

  25. Fourier Decomposition of a step function (64 terms) g(x) i=1 i=2 i=3 i=4 i=5 Example of periodic function created by summing standard trivial functions x i=63 0 127

  26. Fourier Decomposition of a step function (11 terms) g(x) i=1 i=2 i=3 Example of periodic function created by summing standard trivial functions i=4 i=5 i=10 x 0 63

  27. Main concept – summation of base functions Any function of x (any shape) that can be represented by g(x) can also be represented by the summation of cosine functions Observe two numbers for every i

  28. Information is not lost when we change the domain Spatial Domain gi(x) = 1.3, 2.1, 1.4, 5.7, …., i=0,1,2…N-1 N pieces of information Frequency Domain N pieces of information N/2 amplitudes (Ai, i=0,1,…,N/2-1) and N/2 phases (i, i=0,1,…,N/2-1) and

  29. What is spatial frequency? Information is not lost when we change the domain gi(x) and Are equivalent They contain the same amount of information The sequence of amplitudes squared is the SPECTRUM

  30. EXAMPLE

  31. Substitute values A cos(x2i/N) frequency (f) = i/N wavelength (p) = N/I N=512 i f p 0 0 infinite 1 1/512 512 16 1/32 32 256 1/2 2 Assuming N we get this table which relates frequency and wavelength of component functions

  32. More examples to give you some intuition….

  33. Fourier Transform Notation • g(x) denotes an spatial domain function of real numbers • (1.2, 0.0), (2.1, 0.0), (3.1,0.0), … • G() denotes the Fourier transform • G() is a symmetric complex function (-3.1,0.0), (4.1, -2.1), (-3.1, 2.1), …(1.2,0.0) …, (-3.1,-2.1), (4.1, 2.1), (-3.1,0.0) • G[g(x)] = G(f) is the Fourier transform of g(x) • G-1() denotes the inverse Fourier transform • G-1(G(f)) = g(x)

  34. Power Spectrum and Phase Spectrum complex Complex conjugate • |G(f)|2 = G(f)G(f)* is the power spectrum of G(f) • (-3.1,0.0), (4.1, -2.1), (-3.1, 2.1), … (1.2,0.0),…, (-3.1,-2.1), (4.1, 2.1) • 9.61, 21.22, 14.02, …, 1.44,…, 14.02, 21.22 • tan-1[Im(G(f))/Re(G(f))] is the phase spectrum of G(f) • 0.0, -27.12, 145.89, …, 0.0, -145.89, 27.12

  35. 1-D DFT and IDFT Equal time intervals • Discrete Domains • Discrete Time: k = 0, 1, 2, 3, …………, N-1 • Discrete Frequency: n = 0, 1, 2, 3, …………, N-1 • Discrete Fourier Transform • Inverse DFT Equal frequency intervals n = 0, 1, 2,….., N-1 k = 0, 1, 2,….., N-1

  36. Fourier 2D Image Transform

  37. Another formula for Two-Dimensional Fourier Image is function of x and y A cos(x2i/N) B cos(y2j/M) fx = u = i/N, fy = v =j/M Lines in the figure correspond to real value 1 Now we need two cosinusoids for each point, one for x and one for y Now we have waves in two directions and they have frequencies and amplitudes

  38. Fourier Transform of a spot Original image Fourier Transform

  39. Transform Results image transform spectrum

  40. Two Dimensional Fast Fourier in Matlab

  41. Filtering in Frequency Domain … will be covered in a separate lecture on spectral approaches…..

  42. H(u,v) for various values of u and v • These are standard trivial functions to compose the image from

  43. < < image ..and its spectrum

  44. Image and its spectrum

  45. Image and its spectrum

  46. Image and its spectrum

  47. Convolution Theorem Let g(u,v) be the kernel Let h(u,v) be the image G(k,l) = DFT[g(u,v)] H(k,l) = DFT[h(u,v)] Then This is a very important result where means multiplication and means convolution. This means that an image can be filtered in the Spatial Domain or the Frequency Domain.

More Related