Image Transforms Fourier Transform Basic idea 1
Image Transforms Fourier transform theory Let f(x) be a continuous function of a real variable x. The Fourier transform of f(x) is F ( u) f ( x)exp[ j2πux] = dx Given F(u), f(x) can be obtained by using the inverse Fourier transform f ( x) F( u)exp[ j2πux] = du 2
Image Transforms Fourier transform theory The Fourier transform F(u) is general complex F ( u) = R( u) + ji( u) It is often convenient to write it in the form ( 2 2 R ( u) + I ( u) ) j ( u) F( u) = 2 exp 1 [ ] ( ) iφ ( u ) φ = F u e 3
Image Transforms Fourier transform theory Magnitude and Phase 1 2 2 ( u) = ( R ( u) I ( u) ) 2 F + φ 2 2 ( u) = ( R ( u) I ( u) ) P + ( u) = tan 1 I R ( u) ( ) u Fourier Spectrum of f(x) Power Spectrum (spectrum density function) of f(x) Phase angle 4
Image Transforms Fourier transform theory Frequency 1 2 2 ( u) = ( R ( u) I ( u) ) 2 F + φ ( u) = tan 1 I R ( u) ( ) u u is called the frequency variable Euler s formula exp [ j2πux] = cos 2πux j sin 2πux 5
Image Transforms Fourier transform theory Intuitive interpretation An infinite sum of sine and cosine terms, each u determines the frequency of its corresponding sine cosine pair F f ( u) f ( x)exp[ j2πux] = dx ( x) F( u)exp[ j2πux] = du 6
Image Transforms Fourier transform 7
Image Transforms Fourier transform When W become smaller, what will happen to the spectrum? 8
Image Transforms Discrete Fourier transform Continuous function f(x) is discretized into a sequence { f ( x ) f ( x + x), f ( x + 2 x),, f ( x + ( N 1) x) } 0, 0 0 L 0 by taking N samples x units apart 9
Image Transforms Discrete Fourier transform pair of the sampled function F N 1 1 ( u) f ( x + x x) for = N x= u = 0 0 0,1,2,..., exp N 1 f j2πux N 1 ( x) F( u) for N = u= 0 x j2πux exp N = 0,1,2,..., N 1 10
Image Transforms Fourier transform of unit impulse function 0 t 0 t 0 δ( t) = and δ( t) dt = 1 t = 0 11
Image Transforms Fourier transform of unit impulse function F[ δ ( x)] δ = jux e = 1 =0 jux = ( x) e dx δ(x) F x F(ju) 1 0 x 0 u 12
Image Transforms Fourier transform of unit impulse train Here t = x and ω = u 13
Convolution Convolution The convolution of two functions f(x) and g(x), denote f(x)*g(x) f ( x) g( x) = f ( a) g( x a) da 14
Convolution Convolution An example 15
Convolution Convolution and Spatial Filtering f(x,y) w(x,y) f(x,y)*w(x,y) 16
Convolution Convolution theorem f ( x) g( x) F( u) G( u) f ( x) g( x) F( u) G( u) 17
Sampling Sampling f(t) F(u) FT s(t) -w w S(u) t FT 1/ t 1/ t s(t)f(t) 1/ t S(u)*F(u) FT 18
Sampling Sampling 1/ t t FT -w w G(u) f(t) -w w G(u)[S(u)*F(u)]= F(u)] FT 19
Sampling Theorem Bandwidth, Sample Rate, and Nyquist Theorem 1/ t The sampling rate (Nyquist rate) must be at least two times the bandwidth of a bandlimited signal -w w G(u) t 2w -w w G(u)[S(u)*F(u)]= F(u)] 20
Aliasing Over- and under-sampling Anti-aliasing filtering 21
Aliasing Consider an image with 512 alternating vertical black and white stripes. (You may not even be able to see the alternating stripes because of poor screen resolution. But take my word for it, they are there.) Source: http://www.cs.unm.edu/~brayer/vision/perception.html 22
Aliasing The image is created by sampling an image with 512 alternating values of black (gray = 0) and white (gray = 255). Starting in row 0, 512 samples of the image are taken. For each successive row, 1 fewer sample is taken from row 0, (i.e. for row 1, take 511 samples, for row 2, take 510 samples,... for row 511, take 1 sample). The whole row is then reconstructed from the samples by pixel replication. The result is a colossal aliasing pattern. Source: http://www.cs.unm.edu/~brayer/vision/perception.html 23
More examples Aliasing 24
More examples Aliasing 25
More examples Aliasing 26
Image Transforms 2D Fourier Transform (Fourier Transform of Images) F ( u, v) f ( x, y)exp[ j2π ( ux + vy) ] = dxdy ( x, y) F( u, v)exp[ j2π ( ux + vy ] f = ) dudv 27
Image Transforms 2D Fourier Transform (Fourier Fourier Transform of Images) Spectrum 2 2 of f(x) 1 ( u, v) = ( R ( u, v) I ( u, v) ) 2 F + 2 2 ( u, v) = ( R ( u, v) I ( u, v) ) P + φ ( u, v) = tan 1 I R ( u, v) ( ) u, v Power Spectrum (spectrum density function) of f(x) Phase angle 28
29 Image Transforms 2D Discrete Fourier Transform (Fourier Transform of Digital Images) ( ) ( ) 1 0,1,2,..., 1 0,1,2,..., 2 exp, 1, 1 0 1 0 0 0 = = + + + = = = N v M u for N vy M ux j y y x x x x f MN v u F M x N y π ( ) ( ) 1 0,1,2,..., 1 0,1,2,..., 2 exp,, 1 0 1 0 = = + = = = N y M x for N vy M ux j v v u u F y x f M u N v π
Frequency Domain Processing What does frequency mean in an image? 30
Frequency Domain Processing What does frequency mean in an image? 31
Frequency Domain Processing What does frequency mean in an image? 32
Frequency Domain Processing What does frequency mean in an image? High frequency components fast changing/sharp features Low frequency components slow changing/smooth features 33
Frequency Domain Processing The foundation of frequency domain techniques is the convolution theorem f ( x, y) g( x, y) F( u, v) G( u, v) 34
Frequency Domain Processing H(u, v) is called the transfer function 35
Frequency Domain Processing Typical lowpass filters and their transfer functions 36
Frequency Domain Processing Typical lowpass filters and their transfer functions 37
Frequency Domain Processing Example 38
Frequency Domain Processing Example 39
Frequency Domain Processing Typical lowpass filters and their transfer functions 40
Frequency Domain Processing Example 41
Frequency Domain Processing Typical lowpass filters and their transfer functions 42
Frequency Domain Processing Example 43
Frequency Domain Processing Example 44
Frequency Domain Processing Example 45
Frequency Domain Processing Typical highpass filters and their transfer functions 46
Frequency Domain Processing Typical highpass filters and their transfer functions 47
Frequency Domain Processing Typical highpass filters and their transfer functions 48
Frequency Domain Processing Examples 49
Frequency Domain Processing Examples 50
Frequency Domain Processing Examples 51
Frequency Domain Processing More examples 52
Frequency Domain Processing Examples 53
Frequency Domain Processing Examples 54
Frequency Domain Processing Spatial vs frequency domain 55
Frequency Domain Processing Spatial vs frequency domain 56
Frequency Domain Processing Examples 57