Does anyone have any idea how to access elements by row, col in OpenCV 2.0's new "Mat" class? The documentation is linked below, but I have not been able to make any sense of it. http://opencv.willowgarage.com/documentation/cpp/basic%5Fstructures.html#mat
views:
909answers:
2
+1
A:
On the documentation:
http://opencv.willowgarage.com/documentation/cpp/basic%5Fstructures.html#mat
It says:
(...) if you know the matrix element type, e.g. it is float, then you can use at<>() method
That is, you can use:
Mat M(100, 100, CV_8U);
cout << M.at<double>(0,0);
Maybe it is easier to use the Mat* class. It is a template wrapper for Mat. _*Mat* has the operator() overloaded in order to access the elements.
J. Calleja
2009-12-04 11:23:25
ah, thanks very much!
sheldon
2009-12-06 22:09:24