PAC(主成分分析)是eigenface方法的核心。
Algorithmic Description of Eigenfaces method
Let
-
Compute the mean
μ μ=1n∑i=1nxi -
Compute the the Covariance Matrix S
S=1n∑i=1n(xi−μ)(xi−μ)T‘ -
Compute the eigenvalues
λi and eigenvectorsvi ofS Svi=λivi,i=1,2,…,n - Order the eigenvectors descending by their eigenvalue. The
k principal components are the eigenvectors corresponding to thek largest eigenvalues.
The
where
The reconstruction from the PCA basis is given by:
where
where
The Eigenfaces method then performs face recognition by:
- Projecting all training samples into the PCA subspace.
- Projecting the query image into the PCA subspace.
- Finding the nearest neighbor between the projected training images and the projected query image.
Still there's one problem left to solve. Imagine we are given
and get the original eigenvectors of
The resulting eigenvectors are orthogonal, to get orthonormal eigenvectors they need to be normalized to unit length. I don't want to turn this into a publication, so please look into for the derivation and proof of the equations.
详情见:http://docs.opencv.org/3.2.0/da/d60/tutorial_face_main.html