Method Project
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
Project(InputArray)
Projects vector(s) to the principal component subspace.
The methods project one or more vectors to the principal component subspace, where each vector projection is represented by coefficients in the principal component basis. The first form of the method returns the matrix that the second form writes to the result. So the first form can be used as a part of expression while the second form can be more efficient in a processing loop.
public Mat Project(InputArray vec)
Parameters
vecInputArrayinput vector(s); must have the same dimensionality and the same layout as the input data used at %PCA phase, that is, if DATA_AS_ROW are specified, then
vec.cols==data.cols(vector dimensionality) andvec.rowsis the number of vectors to project, and the same is true for the PCA::DATA_AS_COL case.
Returns
Project(InputArray, OutputArray)
Projects vector(s) to the principal component subspace.
public void Project(InputArray vec, OutputArray result)
Parameters
vecInputArrayinput vector(s); must have the same dimensionality and the same layout as the input data used at PCA phase, that is, if DATA_AS_ROW are specified, then
vec.cols==data.cols(vector dimensionality) andvec.rowsis the number of vectors to project, and the same is true for the PCA::DATA_AS_COL case.resultOutputArrayoutput vectors; in case of PCA::DATA_AS_COL, the output matrix has as many columns as the number of input vectors, this means that
result.cols==vec.colsand the number of rows match the number of principal components (for example,maxComponentsparameter passed to the constructor).