Constructor PCA
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
PCA()
default constructor.
The default constructor initializes an empty PCA structure. The other constructors initialize the structure and call PCA::operator()().
public PCA()
PCA(InputArray, InputArray, Flags, int)
Constructor
public PCA(InputArray data, InputArray mean, PCA.Flags flags, int maxComponents = 0)
Parameters
dataInputArrayinput samples stored as matrix rows or matrix columns.
meanInputArrayoptional mean value; if the matrix is empty (@c noArray()), the mean is computed from the data.
flagsPCA.Flagsoperation flags; currently the parameter is only used to specify the data layout (PCA::Flags)
maxComponentsintmaximum number of components that PCA should retain; by default, all the components are retained.
PCA(InputArray, InputArray, Flags, double)
Constructor
public PCA(InputArray data, InputArray mean, PCA.Flags flags, double retainedVariance)
Parameters
dataInputArrayinput samples stored as matrix rows or matrix columns.
meanInputArrayoptional mean value; if the matrix is empty (noArray()), the mean is computed from the data.
flagsPCA.Flagsoperation flags; currently the parameter is only used to specify the data layout (PCA::Flags)
retainedVariancedoublePercentage of variance that PCA should retain. Using this parameter will let the PCA decided how many components to retain but it will always keep at least 2.