Table of Contents

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

data InputArray

input samples stored as matrix rows or matrix columns.

mean InputArray

optional mean value; if the matrix is empty (@c noArray()), the mean is computed from the data.

flags PCA.Flags

operation flags; currently the parameter is only used to specify the data layout (PCA::Flags)

maxComponents int

maximum 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

data InputArray

input samples stored as matrix rows or matrix columns.

mean InputArray

optional mean value; if the matrix is empty (noArray()), the mean is computed from the data.

flags PCA.Flags

operation flags; currently the parameter is only used to specify the data layout (PCA::Flags)

retainedVariance double

Percentage 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.