Title: 3D Geometry for Computer Graphics
13D Geometry forComputer Graphics
2The plan today
- Review of SVD basics
- Connection PCA
- Applications
- Eigenfaces
- Animation compression
3The geometry of linear transformations
- A linear transform A always takes hyper-spheres
to hyper-ellipses.
A
4The geometry of linear transformations
- Thus, one good way to understand what A does is
to find which vectors are mapped to the main
axes of the ellipsoid.
A
5Spectral decomposition
- If we are lucky A V ? VT, V orthogonal
- The eigenvectors of A are the axes of the ellipse
A
6Spectral decomposition
y
x
Rotation VT
Au V ? VTu
7Spectral decomposition
Scale ?
Au V ? VTu
8Spectral decomposition
Rotate V
Au V ? VTu
9General linear transformations SVD
- In general A will also contain rotations, not
just scales
?1
1
1
?2
A
10SVD
y
x
Rotation VT
Au U ? VTu
11Spectral decomposition
Scale ?
Au U ? VTu
12Spectral decomposition
Rotate U
Au U ? VTu
13SVD more formally
- SVD exists for any matrix
- Formal definition
- For square matrices A ? Rn?n, there exist
orthogonal matrices U, V ? Rn?n and a diagonal
matrix ?, such that all the diagonal values ?i of
? are non-negative and
14Reduced SVD
- For rectangular matrices, we have two forms of
SVD. The reduced SVD looks like this - The columns of U are orthonormal
- Cheaper form for computation and storage
M?n
M?n
n?n
n?n
15Full SVD
- We can complete U to a full orthogonal matrix and
pad ? by zeros accordingly
M?n
M?M
M?n
n?n
16SVD is the working horse of linear algebra
- There are numerical algorithms to compute SVD.
Once you have it, you have many things - Matrix inverse ? can solve square linear systems
- Numerical rank of a matrix
- Can solve least-squares systems
- PCA
- Many more
17SVD is the working horse of linear algebra
- Must remember SVD is expensive!
- For a n?n matrix, SVD costs O(n3).
- For sparse matrices could sometimes be cheaper
18Shape matching
- We have two objects in correspondence
- Want to find the rigid transformation that aligns
them
19Shape matching
- When the objects are aligned, the lengths of the
connecting lines are small.
20Shape matching formalization
- Align two point sets
- Find a translation vector t and rotation matrix R
so that
21Summary of rigid alignment
- Translate the input points to the centroids
- Compute the covariance matrix
- Compute the SVD of H
- The optimal rotation is
- The translation vector is
22SVD for animation compression
Chicken animation
233D animations
- Each frame is a 3D model (mesh)
- Connectivity mesh faces
243D animations
- Each frame is a 3D model (mesh)
- Connectivity mesh faces
- Geometry 3D coordinates of the vertices
253D animations
- Connectivity is usually constant (at least on
large segments of the animation) - The geometry changes in each frame ? vast amount
of data, huge filesize!
13 seconds, 3000 vertices/frame, 26 MB
26Animation compression by dimensionality reduction
- The geometry of each frame is a vector in R3N
space (N vertices)
3N ? f
27Animation compression by dimensionality reduction
- Find a few vectors of R3N that will best
represent our frame vectors!
VT f?f
? f?f
U 3N?f
VT
28Animation compression by dimensionality reduction
- The first principal components are the important
ones
u1
u2
u3
29Animation compression by dimensionality reduction
- Approximate each frame by linear combination of
the first principal components - The more components we use, the better the
approximation - Usually, the number of components needed is much
smaller than f.
u3
u1
u2
?1
?2
?3
30Animation compression by dimensionality reduction
ui
- Compressed representation
- The chosen principal component vectors
- Coefficients ?i for each frame
Animation with only 2 principal components
Animation with 20 out of 400 principal components
31Eigenfaces
- Same principal components analysis can be applied
to images
32Eigenfaces
- Each image is a vector in R250?300
- Want to find the principal axes vectors that
best represent the input database of images
33Reconstruction with a few vectors
- Represent each image by the first few (n)
principal components
34Face recognition
- Given a new image of a face, w ? R250?300
- Represent w using the first n PCA vectors
- Now find an image in the database whose
representation in the PCA basis is the closest
The angle between w and w is the smallest
w
w
w
w
35Non-linear dimensionality reduction
- More sophisticated methods can discover
non-linear structures in the face datasets
Isomap, Science, Dec. 2000
36See you next time