我正在尝试在EmguCV中执行PCA:
Matrix matrix = new Matrix(noOfSamples, noOfFeatures);
// put data in matrix
Matrix pMean = new Matrix(1, noOfFeatures);
Matrix pEigVals = new Matrix(noOfFeatures, 1);
Matrix pEigVecs = new Matrix(noOfFeatures, noOfFeatures);
CvInvoke.cvCalcPCA(matrix, pMean, pEigVals, pEigVecs, PCA_TYPE.CV_PCA_DATA_AS_ROW);
但是noOfFeatures > noOfSamples
时出错了。它在其他情况下工作正常。这意味着如果我有大小为32*32=1024=noOfFeatures
的图像,那么我将需要至少1024个样本,这是不切实际的。我只有大约100个样本。在这种情况下如何执行PCA?