1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review...
-
Upload
oswin-flowers -
Category
Documents
-
view
216 -
download
2
Transcript of 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review...
![Page 1: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/1.jpg)
1
Image Processing
• Linear Spaces
• Change of Basis
• Cosines and Sines
• Complex Numbers
Math Review Towards Fourier Transform
![Page 2: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/2.jpg)
2
Part I: Vector Spaces and Basis Vectors
![Page 3: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/3.jpg)
3
Basis Vectors
• A given vector value is represented with respect to a coordinate system.
• The coordinate system is arbitrarily chosen.
• A coordinate system is defined by a set of linearly independent vectors forming the system basis.
• Any vector value is represented as a linear sum of the basis vectors.
v1
v2
a
a= 0.5 *v1+1*v2 (0.5 , 1)v
• v1, v2 are basis vectors• The representation of a with respect to this basis is (0.5,1)
![Page 4: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/4.jpg)
4
Orthonormal Basis Vectors
• If the basis vectors are mutually orthogonal and are unit vectors, the vectors form an orthonormal basis.
• Example: The standard basis is orthonormal:
V1=(1 0)
V2=(0 1)
a
V1=(1 0 0 0 …)
V2=(0 1 0 0 …)
V3=(0 0 1 0 …)
….
![Page 5: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/5.jpg)
5
Change of Basis
• Question: Given a vector av, represented in an orthonormal basis {vi} , what is the representation of av in a different orthonormal basis {ui}?
• Answer:
ivu u,aia
v2
v1
a
u2
u1
ii
uv uiaa
ibicbcb,cwherei
T
![Page 6: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/6.jpg)
6
Change of Basis: Matrix Form
• Defining the new basis as a collection of columns in a matrix form
vT
u aUa
v2
v1
a
u2
u1
uv aUa
nuuuU 21
![Page 7: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/7.jpg)
7
Signal (image) Transforms
1. Basis Functions.
2. Method for finding the transform coefficients given a signal.
3. Method for finding the signal given the transform coefficients.
![Page 8: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/8.jpg)
8
The Orthonormal Standard Basis - 1D
0
1
2
3
4
5
6
7
8
9
Wave Number
Standard Basis Functions - 1D
N = 16
![Page 9: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/9.jpg)
9
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Wave Number
N = 16
The Orthonormal Hadamard Basis – 1D
![Page 10: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/10.jpg)
10
spatial Coordinate
Grayscale Image
[ 2 1 6 1 ]standard=
2 [ 1 0 0 0 ] + 1 [ 0 1 0 0 ] + 6 [ 0 0 1 0 ] + 1 [ 0 0 0 1 ]
Hadamard Transform:
Standard Basis:
Hadamard Transform
Transform Coordinate
Transformed Image
Standard Basis New Basis
[ 2 1 6 1 ]standard =
= 5 [ 1 1 1 1 ]/2 + -2 [ 1 1 -1 -1 ] /2 +
2 [ -1 1 1 -1 ] /2 + -3 [ -1 1 -1 1 ] /2
[ 5 -2 2 -3 ] Hadamard
![Page 11: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/11.jpg)
11
X = [ 2 1 6 1 ] standard
Hadamard Basis:
Finding the transform coefficients
T0 = [ 1 1 1 1 ] /2
T1 = [ 1 1 -1 -1 ] /2
T2 = [ -1 1 1 -1 ] /2
T3 = [ -1 1 -1 1 ] /2
Signal:
Hadamard Coefficients:
a0 = <X,T0 > = < [ 2 1 6 1 ] , [ 1 1 1 1 ] > /2 = 5
a1 = <X,T1 > = < [ 2 1 6 1 ] , [ 1 1 -1 -1 ] > /2 = -2
a2 = <X,T2 > = < [ 2 1 6 1 ] , [ -1 1 1 -1 ] > /2 = 2
a3 = <X,T3 > = < [ 2 1 6 1 ] , [ -1 1 -1 1 ] > /2 = -3
[ 2 1 6 1 ] Standard [ 5 -2 2 -3 ] Hadamard Signal:
![Page 12: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/12.jpg)
12
U CoordinatesV
Coo
rdin
ates
X Coordinate
Y C
oord
inat
e
Grayscale Image
TransformedImage
Transforms: Change of Basis - 2D
The coefficients are arranged in a 2D array.
![Page 13: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/13.jpg)
13
Hadamard Basis Functions
size = 8x8Black = +1 White = -1
![Page 14: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/14.jpg)
14
1 0
0 0[ ]2 1
6 1[ ] 0 1
0 0[ ] 0 0
1 0[ ] 0 0
0 1[ ]+ 1+ 6+ 1 = 2
Hadamard Transform:
Standard Basis:
Transforms: Change of Basis - 2D
5 -2
2 -3[ ] Hadamard
1 1
1 1[ ]2 1
6 1[ ] 1 1
-1 -1[ ] -1 1
1 -1[ ] -1 1
-1 1[ ] -3+2 -2= 5/2 /2 /2 /2
![Page 15: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/15.jpg)
15
X =
New Basis:
Finding the transform coefficients
Signal:
New Coefficients:
a11 = <X,T11 > = sum(sum(X.*T11)) = 5
a12 = <X,T12 > = sum(sum(X.*T12)) = -2
a21 = <X,T21 > = sum(sum(X.*T21)) = 2
a22 = <X,T22 > = sum(sum(X.*T22)) = -3
Signal:
standard
2 1
6 1[ ]
1 1
1 1[ ]/2 1 1
-1 -1[ ]/2
-1 1
1 -1[ ]/2 -1 1
-1 1[ ]/2T21 =
T11 = T12 =
T22 =
X = a11T11 +a12T12 + a21T21 + a22T22
X 5 -2
2 -3 ][new
![Page 16: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/16.jpg)
16
1 1
1 1[ ] 1 1
-1 -1[ ]-1 1
1 -1[ ] -1 1
-1 1[ ] 5 -2
2 -3 ][
Hadamard Transform:
Standard Basis:
[[
[1 0
0 0[ ] 0 1
0 0 ] 0 0
1 0 ] 0 0
0 1 ] 2 1
6 1[ ]
Hadamard
Hadamard
Standardcoefficients
Basis Elements
Basis Elements
coefficients
/2 /2
/2 /2
![Page 17: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/17.jpg)
17
Part II: Sines and Cosines
![Page 18: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/18.jpg)
18
1
1
cos()
sin()
x
2
– The wavelength of sin(x) is 2 .
– The frequency is 1/(2) .
1
Wavelength and Frequency of Sine/Cosin
xsin
![Page 19: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/19.jpg)
19
x
1
2
x
1
kxsin
x
k/2
1
xsin
xsin 2
2/2
![Page 20: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/20.jpg)
20
xπω2sin
ω1
– The wavelength of sin(2x) is 1/ .
– The frequency is .
x
1
– Define K=2
![Page 21: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/21.jpg)
21
x
xA πω2sin
A
– Changing Amplitude:
– Changing Phase:
x
φπω2sin xA
2
![Page 22: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/22.jpg)
22
Sine vs Cosine
sin(x) = cos(x) with a phase shift of /2.
}
/2
sin(x) + cos(x) = ?
![Page 23: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/23.jpg)
23
Sine vs Cosine
3 sin(kx)
4 cos(kx)
5 sin(kx + 0.3)
3 sin(kx) + 4 cos(kx) = sin(kx) with amplitude scaled by 5 and phase shift of 0.3
sin(x) + cos(x) = sin(x) scaled by with a phase shift of /4.
2
![Page 24: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/24.jpg)
24
Combining Sine and Cosine
• If we add a Sine wave to a Cosine wave with the same frequency we get a scaled and shifted (Co-) Sine wave with the same frequency:
• What is the result if a=0?• What is the result if b=0?
kxRkxbkxa sin cossin
a
bbaR 122 tanandwhere
(prove it!)
tan()
![Page 25: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/25.jpg)
25
Part III: Complex Numbers
![Page 26: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/26.jpg)
26
Complex Numbers
The Complex Plane
Real
Imaginary
(a,b)
a
b
• Two kind of representations for a point (a,b) in the complex plane
– The Cartesian representation:
12 iwhereibaZ
– The Polar representation:θReiZ
R
• Conversions:
– Polar to Cartesian:
– Cartesian to Polar
θsinθcosRe θ iRRi abiebaiba /tan22 1
(Complex exponential)
![Page 27: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/27.jpg)
27
• Conjugate of Z is Z*:
– Cartesian rep.
– Polar rep.
ibaiba
θθ ReRe ii
Reala
b
-
-b
θReiiba
θRe iiba
R
R
Imaginary
![Page 28: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/28.jpg)
28
Algebraic operations:
• addition/subtraction:
• multiplication:
• inner Product:
• norm:
)db(i)ca()idc()iba(
adbcibdacidciba
βαβα iii ABeBeAe
222baibaibaiba
2θθθθ2θ ReReReReRe Riiiii
))(()()()(),( * idcibaidcibaidciba
![Page 29: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/29.jpg)
29
Number Multiplication
Re
Im
A
iii ABeBeAe
B
A*B
![Page 30: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/30.jpg)
30
• The (Co-)Sinusoid as complex exponential:
Or
2
ixix eexcos
iee
xsinixix
2
The (Co-) Sinusoid
ixex Realcos
ixex Imagsin
sinicosei
• What about generalization?
S sin(kx) + C cos(kx) = ?
![Page 31: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/31.jpg)
31
We saw that :
S sin(kx) + C cos(kx) = R sin(kx + )
Using Complex exponentials:
Scaling and phase shifting can be represented as a multiplication with
and also
)(Imagsin ikxi eeRkxR
iZ Re
)( *2
1 ikxikxi
eZeZ
)(sin2
1 ikxiikxii
eeReeRkxR
)(Imag ikxeZ
122
SC
tanandRwhere CS
![Page 32: 1 Image Processing Linear Spaces Change of Basis Cosines and Sines Complex Numbers Math Review Towards Fourier Transform.](https://reader035.fdocuments.net/reader035/viewer/2022070413/5697bfab1a28abf838c9ae63/html5/thumbnails/32.jpg)
32
T H E E N D