Dr. Scott Umbaugh, SIUE 20051 Discrete Transforms.
-
Upload
nigel-powell -
Category
Documents
-
view
229 -
download
0
Transcript of Dr. Scott Umbaugh, SIUE 20051 Discrete Transforms.
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 11
Discrete TransformsDiscrete Transforms
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 22
Introduction and OverviewIntroduction and Overview
A transform is essentially a mathematical A transform is essentially a mathematical mapping process mapping process
Used in image analysis and processing to Used in image analysis and processing to provide information regarding the rate at provide information regarding the rate at which the gray levels change within an which the gray levels change within an image – the spatial frequency content of image – the spatial frequency content of an imagean image
The principal component transform The principal component transform decorrelates multiband image datadecorrelates multiband image data
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 33
The wavelet and the haar transforms The wavelet and the haar transforms retain both spatial and frequency retain both spatial and frequency informationinformation
A transform maps image data into a A transform maps image data into a different mathematical space via a different mathematical space via a transformation equation transformation equation
Most of the discrete transforms map the Most of the discrete transforms map the image data from the spatial domain to the image data from the spatial domain to the frequency domain (also called the spectral frequency domain (also called the spectral domain), where domain), where allall the pixels in the input the pixels in the input (spatial domain) contribute to (spatial domain) contribute to eacheach value value in the output (frequency domain) in the output (frequency domain)
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 44
Discrete Transforms
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 55
These transforms are used as tools in These transforms are used as tools in many areas of engineering and science, many areas of engineering and science, including digital imaging commonly in their including digital imaging commonly in their discrete (sampled) formsdiscrete (sampled) forms
The discrete form is created by sampling The discrete form is created by sampling the continuous form of the functions on the continuous form of the functions on which these transforms are based, that is, which these transforms are based, that is, the the basis functionsbasis functions
Basis vectorsBasis vectors are sampled versions of are sampled versions of basis functions for one-dimensional (1-D) basis functions for one-dimensional (1-D) casecase
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 66
Basis imagesBasis images or or basis matricesbasis matrices are are
two-dimensional (2-D) versions of basis two-dimensional (2-D) versions of basis vectors vectors
The process of transforming the image The process of transforming the image data into another domain, or mathematical data into another domain, or mathematical space, amounts to projecting the image space, amounts to projecting the image onto the basis images onto the basis images
The mathematical term for this projection The mathematical term for this projection process is anprocess is an inner productinner product
Frequency transforms can be performed Frequency transforms can be performed on the entire image or smaller blockson the entire image or smaller blocks
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 77
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 88
Spatial frequency and sequency relates to Spatial frequency and sequency relates to how brightness levels change relative to how brightness levels change relative to spatial coordinatesspatial coordinates
FrequencyFrequency is the term for sinusoidal is the term for sinusoidal transforms, transforms, sequency sequency for rectangular wave for rectangular wave transformstransforms
Rapidly changing brightness values Rapidly changing brightness values correspond to high frequency (or sequency) correspond to high frequency (or sequency) terms, slowly changing brightness values terms, slowly changing brightness values correspond to low frequency (or sequency) correspond to low frequency (or sequency) termsterms
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 99
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 1010
The lowest spatial frequency, called the The lowest spatial frequency, called the zero frequency term ( DC term)zero frequency term ( DC term), , corresponds to an image with a constant corresponds to an image with a constant value value
The general form of the transformation The general form of the transformation equation, assuming an N x N image, is equation, assuming an N x N image, is given by:given by:
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 1111
wherewhereuu and and vv are the frequency domain are the frequency domain variables, variables, kk is a constant that is transform dependent, is a constant that is transform dependent, T (u ,v)T (u ,v) are the transform coefficients, are the transform coefficients, and and B (r, c; u ,v)B (r, c; u ,v) correspond to the basis correspond to the basis images images
The notation The notation B (r, c; u ,v)B (r, c; u ,v) defines a set of defines a set of basis images, corresponding to each basis images, corresponding to each different value for different value for uu and and vv, and the size of , and the size of each is each is rr by by cc
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 1212
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 1313
The transform coefficients, The transform coefficients, T (u ,v)T (u ,v), are the , are the projections of projections of I (r ,c)I (r ,c) onto each onto each B (u ,v)B (u ,v)
These coefficients tell us how similar the These coefficients tell us how similar the image is to the basis image; the more alike image is to the basis image; the more alike they are, the bigger the coefficient they are, the bigger the coefficient
This transformation process amounts to This transformation process amounts to decomposing the image into a weighted decomposing the image into a weighted sum of the basis images, where the sum of the basis images, where the coefficients coefficients T (u ,v)T (u ,v) are the weights are the weights
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 1414
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 1515
ExampleExample
Let I (r,c) = Let I (r,c) =
and let and let
B (u,v;r,c) = B (u,v;r,c) =
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 1616
Then T (u ,v)=Then T (u ,v)=
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 1717
To obtain the image from the transform To obtain the image from the transform coefficients we apply the inverse transform coefficients we apply the inverse transform equation:equation:
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 1818
ExampleExample
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 1919
Is this correct? Is this correct? No, since No, since I (r ,c)I (r ,c) = =
• Comparing our results we see that we Comparing our results we see that we must multiply our answer by ¼ must multiply our answer by ¼
• It also tells us that the transform pair, It also tells us that the transform pair, B(u,v;r,c)B(u,v;r,c) and and BB-1-1(u,v;r,c)(u,v;r,c) are not properly are not properly defined, we need to be able to recover our defined, we need to be able to recover our original image to have a proper transform original image to have a proper transform pair pair
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 2020
• We can solve this by letting We can solve this by letting k’k’ = ¼, or by = ¼, or by letting letting kk = = k’k’ = ½ = ½
• ½ will normalize the magnitude of the ½ will normalize the magnitude of the basis images to 1 basis images to 1
• The magnitude of the basis vector is:The magnitude of the basis vector is:
• Therefore, to normalize the magnitude to Therefore, to normalize the magnitude to 1, we need to divide by 2, or multiply by ½ 1, we need to divide by 2, or multiply by ½
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 2121
Basis images should be Basis images should be orthogonalorthogonal and and orthonormalorthonormal
Orthogonal basis imagesOrthogonal basis images Have vector inner products equal to zero Have vector inner products equal to zero Have nothing in commonHave nothing in common Are uncorrelatedAre uncorrelated Remove redundant information Remove redundant information
Orthonormal basis imagesOrthonormal basis images • Are orthogonal and have magnitudes of oneAre orthogonal and have magnitudes of one
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 2222
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 2323
Fourier TransformFourier Transform Fourier transform decomposes a complex Fourier transform decomposes a complex
signal into a weighted sum of a zero signal into a weighted sum of a zero frequency term (the DC term which is frequency term (the DC term which is related to the average value), and related to the average value), and sinusoidal terms, the basis functions, sinusoidal terms, the basis functions, where each sinusoid is a harmonic of the where each sinusoid is a harmonic of the fundamental fundamental
The The fundamentalfundamental is the basic or lowest is the basic or lowest frequency frequency
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 2424
HarmonicsHarmonics are frequency multiples of the are frequency multiples of the fundamental (the fundamental is also fundamental (the fundamental is also called the first harmonic) called the first harmonic)
Original signal can be recreated by adding Original signal can be recreated by adding the fundamental and all the harmonics, the fundamental and all the harmonics, with each term weighted by its with each term weighted by its corresponding transform coefficient corresponding transform coefficient
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 2525
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 2626
Figure 5.2-1(contd)
Decomposing a Square Wave with a Fourier Transform
CVIPtools screen capture of a square and successively adding more harmonics Across the top are the reconstructed squares with 8, 16 and then 32 harmonics Across the bottom are the corresponding Fourier transform magnitude images
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 2727
One-dimensional continuous transform One-dimensional continuous transform can be defined as follows:can be defined as follows:
The basis functions, The basis functions, ee-j2πvc-j2πvc, are complex , are complex exponentials and are sinusoidal in nature exponentials and are sinusoidal in nature
Continuous Fourier transform theory Continuous Fourier transform theory assumes that the functions start at -∞ and assumes that the functions start at -∞ and go to +∞, so they are continuous and go to +∞, so they are continuous and everywhere everywhere
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 2828
Fourier Transform Example
a) The one-dimensional rectangle functionb) the Fourier transform of the 1-D rectangle function
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 2929
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 3030
Fourier Transform Example (contd)
c) Two-dimensional rectangle function as an image
d) Magnitude of Fourier spectrum of the 2-D rectangle
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 3131
The previous example illustrates:The previous example illustrates:
1. Continuous and infinite nature of the 1. Continuous and infinite nature of the basis functions in the underlying theorybasis functions in the underlying theory
2. When we have a function that ends 2. When we have a function that ends abruptly in one domain, such as the abruptly in one domain, such as the function function F(c)F(c), it leads to a continuous , it leads to a continuous series of decaying ripples in the other series of decaying ripples in the other domaindomain
3. The width of the rectangle in one 3. The width of the rectangle in one domain is inversely proportional to the domain is inversely proportional to the spacing of the ripples in the other domainspacing of the ripples in the other domain
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 3232
The One-dimensional Discrete The One-dimensional Discrete Fourier TransformFourier Transform
• The equation for the one-dimensional The equation for the one-dimensional discrete Fourier transform (DFT)discrete Fourier transform (DFT) is: is:
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 3333
• The The inverse DFTinverse DFT is given by: is given by:
where the Fwhere the F-1-1 notation represents the notation represents the inverse transforminverse transform
• The basis functions are sinusoidal in The basis functions are sinusoidal in nature, as can be seen by Euler's identity:nature, as can be seen by Euler's identity:
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 3434
• Putting this equation into the DFT equation Putting this equation into the DFT equation by substituting by substituting θ = -2πvc/Nθ = -2πvc/N , the , the one-one-dimensional DFT equationdimensional DFT equation can be can be written as:written as:
• The The F (v)F (v) terms can be broken down into a terms can be broken down into a magnitude and phase componentmagnitude and phase component
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 3535
Magnitude:Magnitude:
Phase:Phase:
The magnitude of a sinusoid is simply its The magnitude of a sinusoid is simply its peak value, and the phase determines peak value, and the phase determines where the origin is, or where the sinusoid where the origin is, or where the sinusoid starts starts
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 3636
Magnitude and phase of sinusoidal waves
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 3737
Complex Numbers
A complex number shown as a vector and expressed in rectangular form, in terms of the real, R, and imaginary components ,I
A complex number expressed in exponential form in terms of magnitude, M, and angle, θ
Note: θ is measured from the real axis counterclockwise
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 3838
The angle is measured from the real axis counterclockwise, so:
A memory aid for evaluating ejθ
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 3939
ExampleExample
Given Given I(c)I(c) = [3,2,2,1], corresponding to the = [3,2,2,1], corresponding to the brightness values of one row of a digital brightness values of one row of a digital image. Find image. Find F (v) F (v) in both rectangular form, in both rectangular form, and in exponential formand in exponential form
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 4040
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 4141
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 4242
The Two-dimensional Discrete The Two-dimensional Discrete Fourier Transform Fourier Transform
• We can decompose an image into a We can decompose an image into a weighted sum of 2-D sinusoidal termsweighted sum of 2-D sinusoidal terms
• Equation for the Equation for the 2-D discrete Fourier 2-D discrete Fourier transformtransform is: is:
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 4343
Physical Interpretation of a Two-Dimensional Sinusoid
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 4444
• Fourier transform equationFourier transform equation is: is:
• The The magnitudemagnitude is given by: is given by:
• The The phasephase is given by: is given by:
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 4545
Fourier Transform Phase Information
a) Original image b) Phase only image
c) Contrast enhanced version of image (b) to show detail
Note: Phase data contains information about where objects are in the image
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 4646
• The inverse 2-D DFT is given by:The inverse 2-D DFT is given by:
where Fwhere F-1-1 notation represents the inverse notation represents the inverse transformtransform
This equation illustrates that the function,This equation illustrates that the function, I(r,c)I(r,c), is represented by a weighted sum of , is represented by a weighted sum of the basis functions, and that the transform the basis functions, and that the transform coefficients, coefficients, F(u,vF(u,v), are the weights ), are the weights
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 4747
With the inverse Fourier transform, the With the inverse Fourier transform, the sign on the basis functions’ exponent is sign on the basis functions’ exponent is changed from -1 to +1 changed from -1 to +1
However, this only corresponds to the However, this only corresponds to the phase and not the frequency and phase and not the frequency and magnitude of the basis functionsmagnitude of the basis functions
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 4848
• Separability Separability
One of important properties of the Fourier One of important properties of the Fourier transform transform
Means that the two-dimensional basis image Means that the two-dimensional basis image can be decomposed into two product terms can be decomposed into two product terms where each term depends only on the rows where each term depends only on the rows or columns or columns
2-D DFT can be found by successive 2-D DFT can be found by successive application of two 1-D DFTsapplication of two 1-D DFTs
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 4949
Consists of following steps:Consists of following steps:1. Separate the basis image term (also 1. Separate the basis image term (also called the transform kernel) into a product, called the transform kernel) into a product, as follows:as follows:
2. We can then write Fourier transform 2. We can then write Fourier transform equation in the following form:equation in the following form:
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 5050
The advantage of the separability property The advantage of the separability property is that is that F(u, v)F(u, v) or or I(r,c)I(r,c) can be obtained in can be obtained in two steps by successive applications of two steps by successive applications of the one‑dimensional Fourier transform or the one‑dimensional Fourier transform or its inverse its inverse
The equation can be expressed as:The equation can be expressed as:
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 5151
wherewhere
For each value ofFor each value of r r, the expression inside the , the expression inside the brackets is a one‑dimensional transform with brackets is a one‑dimensional transform with frequency values frequency values v = 0,1,2,3, ... N‑1v = 0,1,2,3, ... N‑1
Hence the two‑dimensional function Hence the two‑dimensional function F(r, v)F(r, v) is is obtained by taking a transform along each row ofobtained by taking a transform along each row of I(r,c)I(r,c) and multiplying the result by and multiplying the result by NN
The desired result,The desired result, F(u, v) F(u, v) is obtained by taking is obtained by taking a transform along each column of a transform along each column of F(r, v)F(r, v)
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 5252
Fourier Transform PropertiesFourier Transform Properties
• A Fourier transform pair A Fourier transform pair Refers to an equation in a one domain, Refers to an equation in a one domain,
either spatial or spectral, and its either spatial or spectral, and its corresponding equation in the other corresponding equation in the other domain domain
Implies that if we know what is done in one Implies that if we know what is done in one domain, we know what will occur in the domain, we know what will occur in the other domain other domain
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 5353
• LinearityLinearity The Fourier transform is a linear operator The Fourier transform is a linear operator
and is shown by the following equations:and is shown by the following equations:
where a and b are constantswhere a and b are constants
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 5454
• ConvolutionConvolution Convolution in one domain is the Convolution in one domain is the
equivalent of multiplication in the other equivalent of multiplication in the other domain domain
This is what allows us to perform filtering This is what allows us to perform filtering in the spatial domain with convolution in the spatial domain with convolution masks masks
We use * to denote the convolution We use * to denote the convolution operation, and operation, and F[ ]F[ ] for the forward Fourier for the forward Fourier transform and transform and FF-1-1[ ][ ] for the inverse Fourier for the inverse Fourier transform transform
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 5555
The equations that define convolution The equations that define convolution property are:property are:
It may be computationally less intensive to It may be computationally less intensive to apply filters in the spatial domain of the apply filters in the spatial domain of the image rather than the frequency domain of image rather than the frequency domain of the image, especially if parallel hardware the image, especially if parallel hardware is available is available
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 5656
• TranslationTranslation The translation property of the Fourier The translation property of the Fourier
transform is given by the following transform is given by the following equations:equations:
These equations tell us that if the image is These equations tell us that if the image is moved, the resulting Fourier spectrum moved, the resulting Fourier spectrum undergoes a phase shift, but magnitude of undergoes a phase shift, but magnitude of the spectrum remains the same the spectrum remains the same
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 5757
Translation Property
a) Original image Magnitude of the Fourier spectrum of (a)
Phase of the Fourier spectrum of (a)
d) Original image shifted by 128 rows and 128 columns
Magnitude of the Fourier spectrum of (d)
Phase of the Fourier spectrum of (d)
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 5858
Translation Property (contd)
g) Original image Magnitude of the Fourier spectrum of (g)
Phase of the Fourier spectrum of (g)
These images illustrate that when an image is translated, the phase changes, even though magnitude remains the same
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 5959
• ModulationModulation The modulation property, also called the The modulation property, also called the
frequency translation property, is given by:frequency translation property, is given by:
These equations tell us that if the image is These equations tell us that if the image is multiplied by a complex exponential multiplied by a complex exponential (sinusoid), its corresponding spectrum is (sinusoid), its corresponding spectrum is shifted shifted
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 6060
Modulation Property Results in Frequency Shift
a) Original image b) Magnitude of the Fourier spectrum of (a)
c) (a) multiplied by a vertical cosine wave at a relative frequency of 16
d) Magnitude of the Fourier spectrum of (c)
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 6161
• RotationRotation The rotation property can be easily The rotation property can be easily
illustrated by using polar coordinates:illustrated by using polar coordinates:
The Fourier transform pair The Fourier transform pair I (r ,c)I (r ,c) and and F (u ,v)F (u ,v) become I (x , become I (x ,θθ)) and F (w , and F (w ,Ø)Ø) respectivelyrespectively
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 6262
Fourier transform pair to illustrate the Fourier transform pair to illustrate the rotation property is as follows:rotation property is as follows:
This property tell us that if an image is This property tell us that if an image is rotated by an angle rotated by an angle θθ00, then , then F(u, v)F(u, v) is is
rotated by the same angle, and vice versa rotated by the same angle, and vice versa
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 6363
Rotation Property
a) Original image b) Fourier spectrum image of original image
c) Original image rotated by 90 degrees d) Fourier spectrum image of rotated image
Rotation results in Corresponding Rotations with Image and Spectrum
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 6464
• PeriodicityPeriodicity
The DFT is periodic with period N, for an The DFT is periodic with period N, for an
N x N image. This means:N x N image. This means:
. . This property defines the implied symmetry in the This property defines the implied symmetry in the Fourier spectrum that results from certain Fourier spectrum that results from certain theoretical considerations, which have not been theoretical considerations, which have not been rigorously developed here rigorously developed here
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 6565
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 6666
Displaying the Fourier SpectrumDisplaying the Fourier Spectrum
• The Fourier spectrum consists of complex The Fourier spectrum consists of complex floating point numbers, stored in CVIPtools with floating point numbers, stored in CVIPtools with a a data formatdata format of of complexcomplex – where the – where the image image structurestructure contains a contains a matrixmatrix structure with one structure with one matrix for the real part and one for the imaginary matrix for the real part and one for the imaginary partpart
• In CVIPtools we shift the origin to the center of In CVIPtools we shift the origin to the center of the image by applying the properties of the image by applying the properties of periodicity and modulation with periodicity and modulation with uu00 = v = v00 = N/2 = N/2
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 6767
• Application of periodicity and modulation Application of periodicity and modulation properties with properties with uu00 = v = v00 = N/2 = N/2 : :
• In other words, we can shift the spectrum In other words, we can shift the spectrum by by N/2N/2 by multiplying the original image by by multiplying the original image by (-1) (-1) (r+c)(r+c) which will shift the origin to the which will shift the origin to the center of the imagecenter of the image
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 6868
• It is done in CVIPtools for the following It is done in CVIPtools for the following reasons:reasons:
Easier to understand the spectral Easier to understand the spectral information with the origin in the center information with the origin in the center and frequency increasing from the center and frequency increasing from the center out towards the edges out towards the edges
Makes it easier to visualize the filters Makes it easier to visualize the filters
Looks better Looks better
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 6969
• The actual dynamic range of the Fourier The actual dynamic range of the Fourier spectrum is much greater than the 256 spectrum is much greater than the 256 gray levels (8-bits) available with most gray levels (8-bits) available with most image display devices image display devices
• Therefore, we have to remap it to 256 Therefore, we have to remap it to 256 levels, enabling us to only see the largest levels, enabling us to only see the largest values, which are typically the low values, which are typically the low frequency terms around the origin and/or frequency terms around the origin and/or terms along the terms along the u u and and vv axis axis
• Thus we tend to miss much of the visual Thus we tend to miss much of the visual information due to the limited dynamic information due to the limited dynamic range of display device and the human range of display device and the human visual system’s response visual system’s response
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 7070
Direct Mapping of Fourier Magnitude Data
a) Original image b) Fourier magnitude directly remapped to 0-255 without any enhancement
c) Contrast enhanced versions of (b) d) Contrast enhanced versions of (b)
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 7171
Direct Mapping of Fourier Magnitude Data (contd)
f) Contrast enhanced versions of (b) e) Contrast enhanced versions of (b)
Note that in (f), where we can see the most, the image is visually reduced to being either black or white, most of the dynamic range is lost
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 7272
• To take advantage of the human visual To take advantage of the human visual system’s response to brightness we can system’s response to brightness we can greatly enhance the visual information greatly enhance the visual information available by displaying the following log available by displaying the following log transform of the spectrum:transform of the spectrum:
• The log function compresses the data, and The log function compresses the data, and the scaling factor the scaling factor kk remaps the data to the remaps the data to the 0-255 range 0-255 range
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 7373
Displaying DFT Spectrum with Various Remap Methods
DIRECT REMAP CONTRAST ENHANCED LOG REMAP
Cam.pgm
An Ellipse
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 7474
Displaying DFT Spectrum with Various Remap Methods (contd)
DIRECT REMAP CONTRAST ENHANCED LOG REMAP
House.pgm
A Rectangle
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 7575
Images of Simple Geometric Shapes and Their Fourier Spectral Images
LOG REMAP
Image of a Square
Image of an Ellipse
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 7676
Images of Simple Geometric Shapes and Their Fourier Spectral Images (contd)
LOG REMAP
Image of a Circle
Image of a Small Circle
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 7777
Images of Simple Geometric Shapes and Their Fourier Spectral Images (contd)
LOG REMAP
Image of a Vertical sine wave
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 7878
Phase Phase
Displayed primarily to illustrate phase Displayed primarily to illustrate phase changeschanges
Has a range of 0 to 360 degrees, or 0 to Has a range of 0 to 360 degrees, or 0 to 2π radians 2π radians
Floating point data, so it has a larger Floating point data, so it has a larger dynamic range than the 256 levels dynamic range than the 256 levels typically available for displaytypically available for display
Dr. Scott Umbaugh, SIUE 2005Dr. Scott Umbaugh, SIUE 2005 7979
Displaying Phase Shows Phase Change
a) Original image Phase of the Fourier spectrum of (a)
b) Original image shifted by 128 rows and 128 columns
Phase of the Fourier spectrum of (b)