From 8b7cb8a3f1ec563ed7091e01a526d6da6e6ffd4a Mon Sep 17 00:00:00 2001 From: catree Date: Mon, 3 Jul 2017 16:56:53 +0200 Subject: [PATCH] Fix wrong mat access. --- .../ml/introduction_to_pca/introduction_to_pca.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp b/samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp index 52f9e49f4b..97ac8e8047 100644 --- a/samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp +++ b/samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp @@ -73,7 +73,7 @@ double getOrientation(const vector &pts, Mat &img) eigen_vecs[i] = Point2d(pca_analysis.eigenvectors.at(i, 0), pca_analysis.eigenvectors.at(i, 1)); - eigen_val[i] = pca_analysis.eigenvalues.at(0, i); + eigen_val[i] = pca_analysis.eigenvalues.at(i); } //! [pca] @@ -143,4 +143,4 @@ int main(int, char** argv) waitKey(0); return 0; -} \ No newline at end of file +}