Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

question of using iterator

I want to set the iterator to the specified element of the matrix, but the output is nothing or messy code. The codes are following. pleace help me to understand.Thank you!

include<iostream>

include<opencv2 core="" core.hpp="">

include<opencv2 highgui="" highgui.hpp="">

using namespace std; using namespace cv; int main() { Point2i pi(0,0); Mat n=(Mat_<float>(2,2) << 1.0f, 2.0f, 3.0f, 4.0f); Mat* m=& n; MatConstIterator ito(m, pi); cout <<(*ito); system("pause"); }

click to hide/show revision 2
None

updated 2018-03-08 08:24:20 -0600

berak gravatar image

question of using iterator

I want to set the iterator to the specified element of the matrix, but the output is nothing or messy code. The codes are following. pleace help me to understand.Thank you!

include<iostream>

#include<iostream>
#include<opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
  

include<opencv2 core="" core.hpp="">

include<opencv2 highgui="" highgui.hpp="">

using namespace std; using namespace cv; int main() { Point2i pi(0,0); Mat n=(Mat_<float>(2,2) << 1.0f, 2.0f, 3.0f, 4.0f); Mat* m=& n; MatConstIterator ito(m, pi); cout <<(*ito); system("pause"); }

}