CV_EXPORTS_W void PCACompute(InputArray data, InputOutputArray mean,
OutputArray eigenvectors, int maxComponents = 0);
+/** wrap PCA::operator() and add eigenvalues output parameter */
+CV_EXPORTS_AS(PCACompute2) void PCACompute(InputArray data, InputOutputArray mean,
+ OutputArray eigenvectors, OutputArray eigenvalues,
+ int maxComponents = 0);
+
/** wrap PCA::operator() */
CV_EXPORTS_W void PCACompute(InputArray data, InputOutputArray mean,
OutputArray eigenvectors, double retainedVariance);
+/** wrap PCA::operator() and add eigenvalues output parameter */
+CV_EXPORTS_AS(PCACompute2) void PCACompute(InputArray data, InputOutputArray mean,
+ OutputArray eigenvectors, OutputArray eigenvalues,
+ double retainedVariance);
+
/** wrap PCA::project */
CV_EXPORTS_W void PCAProject(InputArray data, InputArray mean,
InputArray eigenvectors, OutputArray result);
}
void cv::PCACompute(InputArray data, InputOutputArray mean,
+ OutputArray eigenvectors, OutputArray eigenvalues,
+ int maxComponents)
+{
+ CV_INSTRUMENT_REGION()
+
+ PCA pca;
+ pca(data, mean, 0, maxComponents);
+ pca.mean.copyTo(mean);
+ pca.eigenvectors.copyTo(eigenvectors);
+ pca.eigenvalues.copyTo(eigenvalues);
+}
+
+void cv::PCACompute(InputArray data, InputOutputArray mean,
OutputArray eigenvectors, double retainedVariance)
{
CV_INSTRUMENT_REGION()
pca.eigenvectors.copyTo(eigenvectors);
}
+void cv::PCACompute(InputArray data, InputOutputArray mean,
+ OutputArray eigenvectors, OutputArray eigenvalues,
+ double retainedVariance)
+{
+ CV_INSTRUMENT_REGION()
+
+ PCA pca;
+ pca(data, mean, 0, retainedVariance);
+ pca.mean.copyTo(mean);
+ pca.eigenvectors.copyTo(eigenvectors);
+ pca.eigenvalues.copyTo(eigenvalues);
+}
+
void cv::PCAProject(InputArray data, InputArray mean,
InputArray eigenvectors, OutputArray result)
{