Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 4615

Not able to create cv::MatIterator_ in visual studio 2015.

$
0
0
I am working on a simple example using visual studio 2015 with opencv 4.1.0. i am not able to set value for iterator from cv::Mat sample code is shown below. >cv::Mat inputImg = cv::imread(argv[1]); > //convert to > float image cv::Mat flaotImg; >inputImg.convertTo(flaotImg, CV_32FC3, 2.0 / 255.0, -1.0); > cv::MatIterator_ it; >try { > // ... Contents of your main > **it = (flaotImg.begin());** //*Problem* >} >catch (cv::Exception & e) >{ > cerr << e.msg << endl; // output exception message >} **Error:** > OpenCV(4.1.0) Error: Assertion failed > (elemSize() == sizeof(_Tp)) in > cv::Mat::begin, file > c:\opencv\opencv\build\include\opencv2\core\mat.inl.hpp, > line 1273 OpenCV(4.1.0) > c:\opencv\opencv\build\include\opencv2\core\mat.inl.hpp:1273: > error: (-215:Assertion failed) > elemSize() == sizeof(_Tp) in function > 'cv::Mat::begin' ![image description](/upfiles/15568021839981251.png)

Viewing all articles
Browse latest Browse all 4615

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>