Download presentation
Presentation is loading. Please wait.
Published byEustace Sharp Modified over 9 years ago
1
Image as a linear combination of basis images 16 235 245 231 28 20 17 1 0 0 11 243 70 253 99 16 12 0 0 0 14 170 60 253 169 16 6 1 0 0 19 87 69 248 188 18 4 0 0 0 21 171 187 226 82 21 13 11 0 0 22 224 250 188 74 29 7 1 0 0 21 235 247 71 97 92 20 3 0 0 29 251 246 76 45 34 14 0 0 0 65 252 246 183 17 4 0 0 0 1 38 71 162 174 8 0 0 0 0 0
2
= 243 *+ 70 *+… 16 235 245 231 28 20 17 1 0 0 11 243 70 253 99 16 12 0 0 0 14 170 60 253 169 16 6 1 0 0 19 87 69 248 188 18 4 0 0 0 21 171 187 226 82 21 13 11 0 0 22 224 250 188 74 29 7 1 0 0 21 235 247 71 97 92 20 3 0 0 29 251 246 76 45 34 14 0 0 0 65 252 246 183 17 4 0 0 0 1 38 71 162 174 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Image as a linear combination of basis images
3
= 243 *+ 70 *+… 16 235 245 231 28 20 17 1 0 0 11 243 70 253 99 16 12 0 0 0 14 170 60 253 169 16 6 1 0 0 19 87 69 248 188 18 4 0 0 0 21 171 187 226 82 21 13 11 0 0 22 224 250 188 74 29 7 1 0 0 21 235 247 71 97 92 20 3 0 0 29 251 246 76 45 34 14 0 0 0 65 252 246 183 17 4 0 0 0 1 38 71 162 174 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Image as a linear combination of basis images If we agree on basis, then we only need the coefficients (243,70,…) to describe image What about other basis images beyond impulse images?
4
A nice set of basis This change of basis has a special name… Teases away fast vs. slow changes in the image.
5
Jean Baptiste Joseph Fourier (1768-1830) had crazy idea (1807): Any periodic function can be rewritten as a weighted sum of sines and cosines of different frequencies. Don’t believe it? Neither did Lagrange, Laplace, Poisson and other big wigs Not translated into English until 1878! But it’s true! called Fourier Series
6
A sum of sines Our building block: Add enough of them to get any signal f(x) you want! How many degrees of freedom? What does each control? Which one encodes the coarse vs. fine structure of the signal?
7
Fourier Transform We want to understand the frequency of our signal. So, let’s reparametrize the signal by instead of x: f(x) F( ) Fourier Transform F( ) f(x) Inverse Fourier Transform For every from 0 to inf, F( ) holds the amplitude A and phase of the corresponding sine How can F hold both? Complex number trick! We can always go back:
8
Time and Frequency example : g(t) = sin(2pf t) + (1/3)sin(2p(3f) t)
9
Time and Frequency example : g(t) = sin(2pf t) + (1/3)sin(2p(3f) t) = +
10
Frequency Spectra example : g(t) = sin(2pf t) + (1/3)sin(2p(3f) t) = +
11
Frequency Spectra Let’s reconstruct a box using a basis of wiggly functions
12
= + = Frequency Spectra
13
= + =
14
= + =
15
= + =
16
= + =
17
=
19
Extension to 2D in Matlab, check out: imagesc(log(abs(fftshift(fft2(im)))));
20
Man-made Scene
21
Can change spectrum, then reconstruct
22
Low and High Pass filtering
23
The Convolution Theorem The greatest thing since sliced (banana) bread! The Fourier transform of the convolution of two functions is the product of their Fourier transforms The inverse Fourier transform of the product of two Fourier transforms is the convolution of the two inverse Fourier transforms Convolution in spatial domain is equivalent to multiplication in frequency domain!
24
Fourier Transform pairs Reason why gaussian smoothing is better than averaging
25
2D convolution theorem example * f(x,y)f(x,y) h(x,y)h(x,y) g(x,y)g(x,y) |F(s x,s y )| |H(s x,s y )| |G(s x,s y )|
26
Low-pass, Band-pass, High-pass filters low-pass: High-pass / band-pass:
27
Edges in images
28
Where is the edge? Solution: smooth first Look for peaks in
29
Derivative theorem of convolution This saves us one operation:
30
Laplacian of Gaussian Consider Laplacian of Gaussian operator Where is the edge? Zero-crossings of bottom graph
31
2D edge detection filters is the Laplacian operator: Laplacian of Gaussian Gaussianderivative of Gaussian
32
MATLAB demo g = fspecial('gaussian',15,2); imagesc(g) colorbar surfl(g) im = im2single(rgb2gray(‘image.jpg’)); gim = conv2(im,g,'same'); imagesc(conv2(im,[-1 1],'same')); dx = conv2(im,[-1 1],'same'); imagesc(conv2(im,dx,'same')); lg = fspecial('log',15,2); lim = conv2(im,lg,'same'); Imagesc(lim) Imagesc(im +.2*lim)
33
Lossy Image Compression (JPEG) Block-based Discrete Cosine Transform (DCT)
34
Using DCT in JPEG A variant of discrete Fourier transform Real numbers Fast implementation Block size small block –faster –correlation exists between neighboring pixels large block –better compression in smooth regions
35
JPEG compression comparison 89k12k
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.