Error convert static array to cv::Mat
I use this sample form OpenCV tutorial for convert static array to cv::Mat
int a[5] ={1,2,3,4,5};
Mat L(3,a, CV_32SC(1), Scalar::all(0));
cout << L;
But the L variable in invalid. What is reason?is it BUG?
did you mean CV_32SC(1) instead of CV_32SC1(1) ?
what are you trying to achieve ? set up a multidimensional Mat ?
or 2d one with content from an array ?
Thanks.I corrected it. In the OpenCV tutorial on page 130 Use C\C++ arrays and initialize via constructor.One such example is mentioned. After create the L from static array the L variable cols & rows are -1.