我正在嘗試使用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