Ask Your Question

Revision history [back]

(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?

Thanks for yours answers

(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