Einführung in Visual Computing U it 14 Gl b l O Unit 14: Global Operations ti http:// www.caa.tuwien.ac.at/cvl/teaching/sommersemester/evc Content: Image Transformations Fourier Theory Fourier Theory Discrete Fourier Transform (DFT) Hough Transformation 1 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Increasing frequency Image Transformations Increasing frequency
Why transform Data y To de de ‐ correlate correlate data so that fast scalar (rather than slow vector) quantization can be used q To exploit better the characteristics of the Human Visual System Human Visual System (HVS) by separating the data into vision (HVS) by separating the data into vision vision ‐ sensitive parts vision sensitive parts sensitive parts and sensitive parts and vision ‐ insensitive parts. To compact To compact compact most of the ” energy compact most of the energy energy ” in a few coefficients so that to energy in a few coefficients, so that to discard most of the coefficients and thus achieve compression 3 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Transforms Various transforms achieve those properties to various extents Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT) Discrete Cosine Transform (DCT) Other Fourier ‐ like transforms: Oth F i lik t f Haar, Walsh, Hadamard Karhunen ‐ Loeve Transform (KLT) Discrete Wavelet Transforms (DWT) ( ) 4 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Matrix Formulation of Transform Transform is a matrix multiplication of the input signal and the transform ‐ matrix . The standard transform is defined by an N×N square matrix A N . The standard transform is defined by an N×N square matrix A N . Transform of a 1D discrete input signal (a column vector x of N Transform of a 1D discrete input signal (a column vector x of N components) y = y = A N x 5 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Transform Transform of an N×N image X is a transform of each column followed by transform of each row ( separable transform y ( separable transform ) p ) In matrix form, transform of image X is the computation of: XA t t y = A N XA y = y = A XA y = XA N t for The inverse transform is x = x = B N y for 1D signals, and X = X = B N YB YB N images , where t is the transposed matrix, and = A ‐ 1 1 B N = A 6 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Orthonormal Transforms A -1 = A T Thus, the inverse transform is ‐ 1 y for 1D signals, x = A x = A N AA T I 1 ( AA T = I ‐ ‐ 1 1 1 Y(A ‐ ‐ 1 1 1 ) t 1 ) t t for images and X = A X = A N Y(A N Basis vectors 7 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Orthonormal Transforms
Fo rier Fourier Fourier Theory
Fourier Transform Property of transforms: They convert a function from one domain to another with no They convert a function from one domain to another with no loss of information Fourier Transform: Fourier Transform: 1 i i x x G G ( ( ) ) g ( ( t t ) ) e dt dt 2 converts a function from the spatial (or time) domain to the frequency domain 10 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Time Domain and Frequency Domain q y Time Domain: Tells us how properties (air pressure in a sound function, for p p ( p , example) change over time: Amplitude = 100 Amplitude = 100 Frequency = number of cycles in one second = 200 Hz 11 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Time Domain and Frequency Domain q y Frequency domain: Tells us how properties (amplitudes) change over frequencies: Tells us how properties (amplitudes) change over frequencies: 12 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Time Domain and Frequency Domain q y Example: Human ears do not hear wave ‐ like oscilations but constant Human ears do not hear wave like oscilations, but constant tone Often it is easier to work in the frequency domain 13 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
A Sine Wave 8 5*sin (2 4t) 6 Amplitude = 5 4 Frequency = 4 Hz 2 0 0 We take an -2 ideal sine wave to discuss -4 effects of -6 sampling sampling -8 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 seconds seconds 14 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
A sine Wave Signal g 8 5*sin(2 4t) 6 6 Amplitude = 5 4 Frequency = 4 Hz Frequency = 4 Hz 2 Sampling rate = 256 0 samples/second sa p es/seco d -2 Sampling duration = -4 1 second We do sampling of 4Hz -6 signal with 256 Hz so -8 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 sampling is in much Thus after sampling we can higher rate than the base seconds reconstruct the original signal frequency, good frequency, good 15 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
An undersampled Signal p g Here sampling rate is 8.5 Hz and the frequency is 8 Hz sin(2 8t), SR = 8.5 Hz 2 1.5 1 0.5 0 0 Undersampling -0.5 can be confusing H Here it suggests it t -1 a different -1.5 frequency of sampled signal -2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 16 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
The Nyquist Frequency yq q y The Nyquist frequency is equal to one ‐ half of the sampling frequency. q y The Nyquist frequency is the highest frequency that can be measured in a signal. measured in a signal. Nyquist invented method to have a good sampling frequency d l f 17 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Time Domain and Frequency Domain q y In 1807, Jean Baptiste Joseph Fourier showed that any periodic signal could be represented by a series of sinusoidal functions g p y the composition of the first two functions gives the bottom one 18 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Fourier Transform A Fourier Transform is an integral transform integral transform that re ‐ expresses a function in terms of different sine waves different sine waves of varying amplitudes y g amplitudes , p , wavelengths , and phases wavelengths phases . So what does this mean exactly? So what does this mean exactly? Let’s start with an example…in 1 ‐ D Can be represented by: When you let these three waves interfere with each other you get your original wave function! 19 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Time Domain and Frequency Domain q y 20 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Famous Fourier Transforms 2 1 Sine wave 0 In time In time -1 -2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 300 250 200 Delta function 150 100 In frequency In frequency 50 0 0 20 40 60 80 100 120 21 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Famous Fourier Transforms 0.5 0.4 Gaussian 0.3 0.2 In time In time 0.1 0 0 5 10 15 20 25 30 35 40 45 50 6 5 4 4 Gaussian 3 2 In frequency In frequency 1 0 0 50 100 150 200 250 22 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Famous Fourier Transforms 1.5 1 Sinc function 0.5 In time In time 0 -0.5 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 6 5 4 4 Square wave 3 2 In frequency In frequency 1 0 -100 -50 0 50 100 23 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Famous Fourier Transforms 1.5 1 Sinc function 0.5 In time In time 0 -0.5 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 6 5 4 4 Square wave 3 2 In frequency In frequency 1 0 -100 -50 0 50 100 24 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Fourier Transform Since this object can be made up of 3 fundamental frequencies an ideal Fourier Transform would look something like this: Increasing Frequency g q y Increasing Frequency g q y Notice that it is symmetric around the central point and that the amount of points radiating outward correspond to the distinct frequencies used in creating the image. 25 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Let’s Try it with Two ‐ Dimensions! y This image exclusively has This image exclusively has 32 cycles in vertical direction. 8 cycles in horizontal direction. You will notice that the second example is a little more smeared out. This is because the lines are more blurred so more sine waves are required to build it. The transform is weighted so brighter spots indicate sine waves more frequently used. q y 26 Robert Sablatnig, Computer Vision Lab, EVC ‐ 14: Global Operations
Recommend
More recommend