On the documentation:
http://docs.opencv.org/2.4/modules/core/doc/basic_structures.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_64F);
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.
Related Contents:
- Rotate Opencv Matrix by 90, 180, 270 degrees [duplicate]
- Image Processing: Algorithm Improvement for ‘Coca-Cola Can’ Recognition
- How to detect a Christmas Tree?
- What are the most widely used C++ vector/matrix math/linear algebra libraries, and their cost and benefit tradeoffs? [closed]
- OpenCV C++/Obj-C: Detecting a sheet of paper / Square Detection
- OpenCV Point(x,y) represent (column,row) or (row,column)
- What does OpenCV’s cvWaitKey( ) function do?
- Confusion between C++ and OpenGL matrix order (row-major vs column-major)
- Does performance differ between Python or C++ coding of OpenCV?
- What is the fastest way to transpose a matrix in C++?
- Accessing certain pixel RGB value in openCV
- Vector of Vectors to create matrix
- Convert Eigen Matrix to C array
- What are the differences between CV_8U and CV_32F and what should I worry about when converting between them?
- What does CV_8UC3 and the other types stand for in OpenCV?
- Recommended values for OpenCV detectMultiScale() parameters
- Rotate an image without cropping in OpenCV in C++
- Convert RGB to Black & White in OpenCV
- Camera position in world coordinate from cv::solvePnP
- Find OpenCV Version Installed on Ubuntu [duplicate]
- using OpenCV and SVM with images
- Convert Mat to Array/Vector in OpenCV
- Classification of detectors, extractors and matchers
- Simple illumination correction in images OpenCV C++
- Installing OpenCV 2.4.3 in Visual C++ 2010 Express [closed]
- openCV program compile error “libopencv_core.so.2.4: cannot open shared object file: No such file or directory” in ubuntu 12.04
- How can I determine distance from an object in a video?
- Executing cv::warpPerspective for a fake deskewing on a set of cv::Point
- g++ ld: symbol(s) not found for architecture x86_64
- Converting cv::Mat to IplImage*
- c++ and opencv get and set pixel color to Mat
- Writing robust (color and size invariant) circle detection with OpenCV (based on Hough transform or other features)
- How to convert an OpenCV cv::Mat to QImage
- How to convert an OpenCV cv::Mat to QImage
- How to map the indexes of a matrix to a 1-dimensional array (C++)?
- How to solve munmap_chunk(): invalid pointer error in C++
- Extracting segments from a list of 8-connected pixels
- Installing C++ Libraries on OS X
- How to correctly use cv::triangulatePoints()
- Simple 3×3 matrix inverse code (C++)
- Shift image content with OpenCV
- connected components in OpenCV
- how to check whether two matrices are identical in OpenCV
- OpenCV get pixel channel value from Mat image
- Compiling a static executable with CMake
- Resize image OpenCV
- cmake find_package specify path
- OpenCV 3.0: Calibration not fitting as expected
- OpenCV CV::Mat and Eigen::Matrix
- Accessing elements of a cv::Mat with at(i, j). Is it (x,y) or (row,col)?