..ocv:function:: PCA::PCA(InputArray data, InputArray mean, int flags, int maxComponents=0)
..ocv:function:: PCA::PCA(InputArray data, InputArray mean, int flags, double retainedVariance)
:param data:input samples stored as matrix rows or matrix columns.
:param mean:optional mean value; if the matrix is empty (``noArray()``), the mean is computed from the data.
@ -2252,7 +2254,9 @@ PCA constructors
:param maxComponents:maximum number of components that PCA should retain; by default, all the components are retained.
The default constructor initializes an empty PCA structure. The second constructor initializes the structure and calls
:param retainedVariance: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.
The default constructor initializes an empty PCA structure. The other constructors initialize the structure and call
:ocv:funcx:`PCA::operator()` .
@ -2263,6 +2267,8 @@ Performs Principal Component Analysis of the supplied dataset.
..ocv:function:: PCA& PCA::operator()(InputArray data, InputArray mean, int flags, int maxComponents=0)
..ocv:function:: PCA& PCA::operator()(InputArray data, InputArray mean, int flags, double retainedVariance)
:param data:input samples stored as the matrix rows or as the matrix columns.
@ -2277,6 +2283,8 @@ Performs Principal Component Analysis of the supplied dataset.
:param maxComponents:maximum number of components that PCA should retain; by default, all the components are retained.
:param retainedVariance: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.
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 ``eigenvalues``, ``eigenvectors`` , and ``mean`` are allocated and computed.
The computed eigenvalues are sorted from the largest to the smallest and the corresponding eigenvectors are stored as ``PCA::eigenvectors`` rows.