mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 22:44:02 +08:00
Fix implementation of PCA overload with retained variance parameter
This commit is contained in:
parent
d0ec65e80c
commit
15076f9232
@ -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);
|
||||
}
|
||||
|
@ -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());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user