access matrix value opencv

Solutions on MaxInterview for access matrix value opencv by the best coders in the world

showing results for - "access matrix value opencv"
Isabelle
27 May 2017
1On the documentation:
2
3http://docs.opencv.org/2.4/modules/core/doc/basic_structures.html#mat
4
5It says:
6
7(...) if you know the matrix element type, e.g. it is float, then you can use at<>() method
8
9That is, you can use:
10
11Mat M(100, 100, CV_64F);
12cout << M.at<double>(0,0);
13Maybe 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.