Normalize line endings and whitespace
This commit is contained in:

committed by
Andrey Kamaev

parent
0442bca235
commit
81f826db2b
@@ -2986,21 +2986,21 @@ PCA& PCA::operator()(InputArray _data, InputArray __mean, int flags, double reta
|
||||
g.at<float>(ig,0) += eigenvalues.at<float>(im,0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int L;
|
||||
for(L = 0; L < eigenvalues.rows; L++)
|
||||
{
|
||||
double energy = g.at<float>(L, 0) / g.at<float>(g.rows - 1, 0);
|
||||
if(energy > retainedVariance)
|
||||
break;
|
||||
if(energy > retainedVariance)
|
||||
break;
|
||||
}
|
||||
|
||||
L = std::max(2, L);
|
||||
|
||||
|
||||
// use clone() to physically copy the data and thus deallocate the original matrices
|
||||
eigenvalues = eigenvalues.rowRange(0,L).clone();
|
||||
eigenvectors = eigenvectors.rowRange(0,L).clone();
|
||||
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user