Fix implementation of PCA overload with retained variance parameter

This commit is contained in:
Andrey Kamaev 2012-10-22 18:39:56 +04:00
parent d0ec65e80c
commit 15076f9232
2 changed files with 3 additions and 3 deletions

View File

@ -2813,7 +2813,7 @@ PCA::PCA(InputArray data, InputArray _mean, int flags, int maxComponents)
PCA::PCA(InputArray data, InputArray _mean, int flags, double retainedVariance)
{
operator()(data, _mean, flags, retainedVariance);
computeVar(data, _mean, flags, retainedVariance);
}
PCA& PCA::operator()(InputArray _data, InputArray __mean, int flags, int maxComponents)
@ -3077,7 +3077,7 @@ void cv::PCAComputeVar(InputArray data, InputOutputArray mean,
OutputArray eigenvectors, double retainedVariance)
{
PCA pca;
pca(data, mean, 0, retainedVariance);
pca.computeVar(data, mean, 0, retainedVariance);
pca.mean.copyTo(mean);
pca.eigenvectors.copyTo(eigenvectors);
}

View File

@ -426,7 +426,7 @@ protected:
}
// 3. check C++ PCA w/retainedVariance
cPCA( rPoints.t(), Mat(), CV_PCA_DATA_AS_COL, retainedVariance );
cPCA.computeVar( rPoints.t(), Mat(), CV_PCA_DATA_AS_COL, retainedVariance );
diffPrjEps = 1, diffBackPrjEps = 1;
Mat rvPrjTestPoints = cPCA.project(rTestPoints.t());