linear algebra and svd (some slides adapted from octavia camps)
Post on 19-Dec-2015
216 views
TRANSCRIPT
![Page 1: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/1.jpg)
Linear Algebra and SVD(Some slides adapted from Octavia Camps)
![Page 2: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/2.jpg)
Goals
• Represent points as column vectors.
• Represent motion as matrices.
• Move geometric objects with matrix multiplication.
• Introduce SVD
![Page 3: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/3.jpg)
Euclidean transformations
![Page 4: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/4.jpg)
2D Translation
tt
PP
P’P’
![Page 5: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/5.jpg)
2D Translation Equation
PP
xx
yy
ttxx
ttyy
P’P’tt
tPP ),(' yx tytx
),(
),(
yx tt
yx
t
P
![Page 6: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/6.jpg)
2D Translation using Matrices
PP
xx
yy
ttxx
ttyy
P’P’tt
),(
),(
yx tt
yx
t
P
1
1
0
0
1' y
x
t
t
ty
tx
y
x
y
xP
tt PP
![Page 7: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/7.jpg)
Scaling
PP
P’P’
![Page 8: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/8.jpg)
Scaling Equation
PP
xx
yy
s.xs.x
P’P’s.ys.y
),('
),(
sysx
yx
P
P
PP s'
y
x
s
s
sy
sx
0
0'P
SPSP '
![Page 9: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/9.jpg)
Rotation
PP
PP’’
![Page 10: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/10.jpg)
Rotation Equations
Counter-clockwise rotation by an angle Counter-clockwise rotation by an angle
y
x
y
x
cossin
sincos
'
'
PP
xx
Y’Y’PP’’
X’X’
yy R.PP'
![Page 11: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/11.jpg)
Why does multiplying points by R rotate them?
• Think of the rows of R as a new coordinate system. Taking inner products of each points with these expresses that point in that coordinate system.
• This means rows of R must be orthonormal vectors (orthogonal unit vectors).
• Think of what happens to the points (1,0) and (0,1). They go to (cos theta, -sin theta), and (sin theta, cos theta). They remain orthonormal, and rotate clockwise by theta.
• Any other point, (a,b) can be thought of as a(1,0) + b(0,1). R(a(1,0)+b(0,1) = Ra(1,0) + Ra(0,1) = aR(1,0) + bR(0,1). So it’s in the same position relative to the rotated coordinates that it was in before rotation relative to the x, y coordinates. That is, it’s rotated.
![Page 12: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/12.jpg)
Degrees of Freedom
R is 2x2 R is 2x2 4 elements4 elements
BUT! There is only 1 degree of freedom: BUT! There is only 1 degree of freedom:
1)det(
R
IRRRR TT
The 4 elements must satisfy the following constraints:The 4 elements must satisfy the following constraints:
y
x
y
x
cossin
sincos
'
'
![Page 13: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/13.jpg)
Transformations can be composed
• Matrix multiplication is associative.
• Combine series of transformations into one matrix. (example, whiteboard).
• In general, the order matters. (example, whiteboard).
• 2D Rotations can be interchanged. Why?
![Page 14: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/14.jpg)
Rotation and Translation
cos -sin tx
sin cos ty
0 0 1
( )(x
y
1)
a -b tx
b a ty
0 0 1
( )(x
y
1)
Rotation, Scaling and Translation
![Page 15: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/15.jpg)
Rotation about an arbitrary point
• Can translate to origin, rotate, translate back. (example, whiteboard).
• This is also rotation with one translation.– Intuitively, amount of rotation is same
either way.– But a translation is added.
![Page 16: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/16.jpg)
Stretching Equation
PP
xx
yy
SSxx.x.x
P’P’SSyy.y.y
y
xs
s
ys
xs
y
x
y
x
0
0'P
),('
),(
ysxs
yx
yx
P
P
S
PSP '
![Page 17: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/17.jpg)
Stretching = tilting and projecting(with weak perspective)
y
xs
s
sy
xs
s
ys
xsy
x
yy
x
y
x
10
00
0'P
![Page 18: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/18.jpg)
SVD
• For any matrix, M = R1DR2
– R1, R2 are rotation matrices
– D is a diagonal matrix.– This decomposition is unique.– Efficient algorithms can compute this (in
matlab, svd).
![Page 19: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/19.jpg)
Linear Transformation
y
xs
s
s
y
xs
s
y
x
dc
ba
y
x
y
y
x
sincos
cossin
10
0
sincos
cossin
sincos
cossin0
0
sincos
cossin
'PSVD
![Page 20: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/20.jpg)
Affine Transformation
1
' y
x
tydc
txbaP
![Page 21: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/21.jpg)
Simple 3D Rotation
n
n
n
zzz
yyy
xxx
21
21
21...
100
0cossin
0sincos
Rotation about z axis.
Rotates x,y coordinates. Leaves z coordinates fixed.
![Page 22: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/22.jpg)
Full 3D Rotation
cossin0
sincos0
001
cos0sin
010
sin0cos
100
0cossin
0sincos
R
• Any rotation can be expressed as combination of three rotations about three axes.
100
010
001TRR
• Rows (and columns) of R are orthonormal vectors.
• R has determinant 1 (not -1).
![Page 23: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/23.jpg)
• Intuitively, it makes sense that 3D rotations can be expressed as 3 separate rotations about fixed axes. Rotations have 3 degrees of freedom; two describe an axis of rotation, and one the amount.
• Rotations preserve the length of a vector, and the angle between two vectors. Therefore, (1,0,0), (0,1,0), (0,0,1) must be orthonormal after rotation. After rotation, they are the three columns of R. So these columns must be orthonormal vectors for R to be a rotation. Similarly, if they are orthonormal vectors (with determinant 1) R will have the effect of rotating (1,0,0), (0,1,0), (0,0,1). Same reasoning as 2D tells us all other points rotate too.
• Note if R has determinant -1, then R is a rotation plus a reflection.
![Page 24: Linear Algebra and SVD (Some slides adapted from Octavia Camps)](https://reader036.vdocuments.us/reader036/viewer/2022062407/56649d3a5503460f94a15723/html5/thumbnails/24.jpg)
3D Rotation + Translation
• Just like 2D case