Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
Mat input_feature_vector(input_array);

will make a 1-col, n-row Mat.

either change the flag to CV_PCA_DATA_AS_COL ,

or do :

Mat input_as_row = input_feature_vector.reshape(1,1); // no fear, it's cheap
PCA pca(input_as_row,Mat(),CV_PCA_DATA_AS_ROW, 0);