Matrix Acces opencv matrix CV_32S

if I have a matrix of type CV_32SC1 that I use typename shuld in the function Mat :: at?

eg.

Mat X; // for example eye matrix of size 10,10,and type CV_32SC1 X.at<??????>(1,1)=5; 
  • How can I find typename for other types of matrices?
+8
c ++ matrix opencv
source share
2 answers

The general rule for matrix type types in OpenCV is:

  CV_<bit_depth>(S|U|F)C<number_of_channels> S = Signed integer U = Unsigned integer F = Float 

So, depending on which of the previous letters (S, U, F) you have, you will sketch <int> , <unsigned integer> or <float> .

+15
source share

CV_32SC1 is a 1-channel signal 32-bit integer, then I think that X.at<int>() should do.

Mat already "knows" how to access the pixel, the type simply passes the bit to the C ++ value that is required to evaluate the expression.

I found here some explanation regarding notation.

+3
source share

All Articles