Image Compression using Singular Value Decomposition
Math 320Kristen Cunanan
Michael Tzen
Reading a matrix into MatlabCommand:
data=imread(“title”,”format”)
datanmp
Singular Value Decomposition
data USV T
Snm
1 0 00 2 0 0 n0 0
SVD in Matlab
we must do svd p times on each “page” of the array.
Command:
= svd(data(:,:,:i)i=1…p
datanmp
Ui,Si,Vi
Selecting for the number of Singular Values
S*nm
1 0 00 * 0 0 0
data* US*V T
Using 1 Singular Value
Using 11 Singular Values
Using 31 Singular Values
Using 51 Singular Values
Using 91 Singular Values
269 Singular Values
Eigenfaces/Facial Recognition
Process
• Is person X in the “training” group of M=50?
• SVD on manipulated pictures
• Is Euclidean distance in the threshold?
Prep Work
Image I Data matrix
“Training Set” of images
},...,,{ 21 MS
0
Subtracting the Mean
• Compute the Mean of S = Training set
• Subtract Mean from ea. face/vector in S
},...,,{ 21 M
Covariance Matrix
• Get the Covariance Matrix of S
SVD on C =
• SVD method on C to get the eigenvalues/eigenvectors
• Gives us the “important” values/vectors corresponding to each difference vector
Eigenvector = Eigenface
• The eigenvectors obtained, are called Eigenfaces
• Any can be written as a linear combination of the eigenfaces
=.87 + .2
+ .10 + .1
Euclidean distance
||||min 0l
lre
Conclusion
• If Value (Specified)– Human Face ~ 1500 range
• McMillen = Bradd Pittrere
re
Otherwise McMillen = Will Smith?