From 873399705d58979a905357bea030bf88cd77cddd Mon Sep 17 00:00:00 2001 From: StevenPuttemans Date: Fri, 5 Feb 2016 13:21:40 +0100 Subject: [PATCH] add clarification on the acces paramter of the at operator --- modules/core/include/opencv2/core/mat.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/core/include/opencv2/core/mat.hpp b/modules/core/include/opencv2/core/mat.hpp index ffec538..1fa0a76 100644 --- a/modules/core/include/opencv2/core/mat.hpp +++ b/modules/core/include/opencv2/core/mat.hpp @@ -1702,6 +1702,14 @@ public: for(int j = 0; j < H.cols; j++) H.at(i,j)=1./(i+j+1); @endcode + + Keep in mind that the size identifier used in the at operator cannot be chosen at random. It depends + on the image from which you are trying to retrieve the data. The table below gives a better insight in this: + - If matrix is of type `CV_8U` or `CV_8S` then use `Mat.at(y,x)`. + - If matrix is of type `CV_16U` or `CV_16S` then use `Mat.at(y,x)`. + - If matrix is of type `CV_32S` or `CV_32F` then use `Mat.at(y,x)`. + - If matrix is of type `CV_64FU` then use `Mat.at(y,x)`. + @param i0 Index along the dimension 0 */ template _Tp& at(int i0=0); -- 2.7.4