Click or drag to resize

PCACompute Method

Performs PCA. The operator performs %PCA of the supplied dataset. It is safe to reuse the same PCA structure for multiple datasets. That is, if the structure has been previously used with another dataset, the existing internal data is reclaimed and the new @ref eigenvalues, @ref eigenvectors and @ref mean are allocated and computed. The computed @ref eigenvalues are sorted from the largest to the smallest and the corresponding @ref eigenvectors are stored as eigenvectors rows.

Namespace:  OpenCvSharp
Assembly:  OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0
Syntax
public PCA Compute(
	InputArray data,
	InputArray mean,
	PCAFlags flags,
	int maxComponents = 0
)

Parameters

data
Type: OpenCvSharpInputArray
input samples stored as the matrix rows or as the matrix columns.
mean
Type: OpenCvSharpInputArray
optional mean value; if the matrix is empty (noArray()), the mean is computed from the data.
flags
Type: OpenCvSharpPCAFlags
operation flags; currently the parameter is only used to specify the data layout. (Flags)
maxComponents (Optional)
Type: SystemInt32
maximum number of components that PCA should retain; by default, all the components are retained.

Return Value

Type: PCA

[Missing <returns> documentation for "M:OpenCvSharp.PCA.Compute(OpenCvSharp.InputArray,OpenCvSharp.InputArray,OpenCvSharp.PCA.Flags,System.Int32)"]

See Also