400 likes | 411 Views
Explore the spatial and frequency domains, Fourier analysis techniques, and the Discrete Fourier Transform in image processing applications.
E N D
Lecture 13The frequency Domain (1) Dr. Masri Ayob
The Twilight Zone • Image data can be represented in either the spatialdomain or thefrequencydomain. The frequency domain contains the same information as the spatial domain but in a vastly different form. • Useful for data compression • More efficient for certain image operations Spatial Domain For each location in the image, what is the value of the light intensity at that location? Frequency Domain For each frequency component in the image, what is power or its amplitude? • Various frequency domain representations exist but the two predominant representations are theFourier and Discrete Cosine representations. • Frequency domain - an alternative representation of an image based on the frequencies of brightness or colour variation in the image.
Fourier Transform Spatial Domain vs Frequency Domain t f
Fourier Transform • Why? • alternative description • efficient calculation • less sensitive for • disturbances • Obey the convolution thorem • More efficient, easier: • convolution • correlation • filtering • differentiating • shifting • compression
Fourier Transform • Applications wide ranging and ever present in modern life • Telecomms - GSM/cellular phones, • Electronics/IT - most DSP-based applications, • Entertainment - music, audio, multimedia, • Accelerator control (tune measurement for beam steering/control), • Imaging, image processing, • Industry/research - X-ray spectrometry, chemical analysis (FT spectrometry), PDE solution, radar design, • Medical - (PET scanner, CAT scans & MRI interpretation for sleep disorder & heart malfunction diagnosis, • Speech analysis (voice activated “devices”, biometry, …).
Fourier Analysis • Many different transforms are used in image processing (far too many begin with the letter H: Hilbert, Hartley, Hough, Hotelling, Hadamard, and Haar). • The Fourier representation of any function is possible by determining • The fundamental frequency • The coefficient of each harmonic • Fourier coefficients are typically Complex-valued • Fundamental frequency is determined by theresolutionof a discrete image
Spatial Frequency L = length of the cycle (period of the function). If the variation is spatial and L is a distance, then 1/L is termed the spatial frequency of the variation.
Spatial Frequency N=100, u=3, A=127 N=100, u=6, A=127 Variation in the x – direction (u) N=100, u=3, A=50 Sin Cosine N=100, u=3, A=127, phase = 90
Fourier Theory • Techniques for the analysis and manipulation of spatial frequency. • Developed a representation of functions based on frequency. • The idea is “any periodic function can be represented as a sum of these simpler sinusoids”.
Fourier Analysis • Any function can be represented as the sumof sineand cosinewaves having different amplitudes and wavelengths. • Fourier analysis is a way of determining the individual sin/cosine waves that, when added together, construct the desired signal • Consider a square wave. Can it be represented as the sum of sin and cosine waves?
Fourier Theory • A set of sine and cosine functions having particular frequencies are choose for the representation. basic function
Fourier Theory • A weighted sum of these basic function is called a Fourier Series. Add a 3rd “harmonic” to the fundamental frequency. The amplitude is less than that of the base and the frequency is 3 times that of the base.
Fourier Theory • The weighting factors for each sine and cosine function are known as the Fourier coefficients. The summation of basic function No. of terms
Fourier Theory Add a 3rd “harmonic” to the fundamental frequency. The amplitude is less than that of the base and the frequency is 3 times that of the base.
Fourier Theory Add a 5th “harmonic” to the fundamental frequency. The amplitude is less than that of the base and the frequency is 5 times that of the base.
Fourier Theory Add a 7th and 9th“harmonic” to the fundamental frequency.
Fourier Theory Adding all harmonics up to the 100th.
Fourier Theory Adding all harmonics up to the 200th.
Fourier Theory L: period; u and v are the number of cycles fitting into one horizontal and vertical period, respectively of f(x,y).
Discrete Fourier Transform • Fourier theory provides us with a means of determining the contribution made by any basic function to the representation of some function f(x). • The contribution is determined by projecting f(x) onto that basis function. • This procedure is described as a Fourier transform.
Discrete Fourier Transform • When applying the procedure to images, we must deal explicitly with the fact that an image is: • Two-dimensional • Sampled • Of finite extent • These consideration give rise to the Discrete Fourier Transform (DFT). • The DFT of an NxN image can be written: or (8.5) Complex number Processing the image in frequency domain
Discrete Fourier Transform • For any particular spatial frequency specified by u and v, evaluating equation 8.5 tell us how much of that particular frequency is present in the image. • There also exist an inverse Fourier Transform that convert a set of Fourier coefficients into an image. Processing the image in spatial domain
Discrete Fourier Transform F(u,v) is a complex number:
Discrete Fourier Transform • The magnitudes correspond to the amplitudes of the basic images in our Fourier representation. • The array of magnitudes is termed the amplitude spectrum (or sometime ‘spectrum’). • The array of phases is termed the phase spectrum. • The power spectrum is simply the square of its amplitude spectrum:
Discrete Fourier Transform If we attempt to reconstruct the image with an inverse Fourier Transform after destroying either the phase information or the amplitude information, then the reconstruction will fail.
FFT • The Fast Fourier Transform is one of the most important algorithms ever developed • Developed by Cooley and Tukey in mid 60s. • Is a recursive procedure that uses some cool math tricks to combine sub-problem results into the overall solution.
Periodicity • The DFT assumes that an image is part of an infinitely repeated set of “tiles” in every direction. This is the same effect as “circular indexing”.
Spatial discontinuities Periodicity and Windowing • Since “tiling” an image causes “fake” discontinuities, the spectrum includes “fake” high-frequency components • Windowingminimizes the artificial discontinuities by pre-processing pixel values prior to computing the DFT. • Pixel values are modulated so that they gradually fall to zero at the edges. • Three well-known windowing functions: • Bartlett • Hanning • Blackman
Bartlett Hanning Windowing Functions R is a distance from the centre of the image and rmax is its maximum value. Blackman