我正在尝试使用python构建面部识别的代码。现在我可以将我的所有数据库图像放入一个二维数组中,以便能够对它们应用主成分分析(PCA)。我在matplotlib中找到了一个名为PCA的类,但我想知道如何将它用于人脸识别。如何使用matplotlib中的类PCA进行人脸识别?
这里所提到的类的描述:
class matplotlib.mlab.PCA(a)
compute the SVD of a and store data for PCA. Use project to project the data onto a reduced set of dimensions
Inputs:
a: a numobservations x numdims array
Attrs:
a a centered unit sigma version of input a
numrows, numcols: the dimensions of a
mu : a numdims array of means of a
sigma : a numdims array of atandard deviation of a
fracs : the proportion of variance of each of the principal components
Wt : the weight vector for projecting a numdims point or array into PCA space
Y : a projected into PCA space
The factor loadings are in the Wt factor, ie the factor loadings for the 1st principal component are given by Wt[0]
虽然这些链接可能会回答问题,最好在这里包含答案的重要部分,并提供参考链接。如果链接页面更改,则仅链接答案可能会失效。 – Matsemann 2013-05-22 16:50:33