(TUTORIAL) introduction_to_pca
Hi,
I want to run tutorial introduction_to_pca with image pca_test1.jpg in folder sample/data. When I launch this tutorial I have got this error :
OpenCV Error: Assertion failed (dims <= 2 && data && (unsigned)i0 < (unsigned)size.p[0] && (unsigned)(i1 * DataType<_Tp>::channels)
< (unsigned)(size.p[1] * channels()) && ((((sizeof(size_t)<<28)|0x8442211) >> ((DataType<_Tp>::depth) & ((1 << 3) - 1))*4) & 15) ==
elemSize1()) in cv::Mat::at, file F:\Lib\opencv\modules\core\include\opencv2/core/mat.inl.hpp, line 872
In source introduction_to_pca error occurs.cpp at line 76
eigen_val[i] = pca_analysis.eigenvalues.at<double>(0, i);
Have you got same errors using opencv 3.0 windows 7-64bits visual studio 2013?
Is it a good idea to change line 76 in
eigen_val[i] = pca_analysis.eigenvalues.at<double>(i, 0);
Thanks for yours answers
@LBerger it is strange that you get this error, here it works without any issues. However, I am in linux and qtcreator environment. As, for changing the code in line 76 you can do it freely. It does not affect, the outcome.
I have added before line 76
result is 2 rows and 1 column
@theodore, are you running a debug build ? this is one of the dreaded CV_DbgAsserts, that do not show up in release.
also, imho @LBerger is right, it should be
pca_analysis.eigenvalues.at<double>(i, 0);
@berak yup I am running it in the debug mode and no problem.
i'm getting the same exception.
I see. In what kind of environment are you e.g. windows, linux, visual studio, etc...