Monday 15 April 2013

How to access element of a sigle row Mat in OpenCv? -


I have a seagull line mat of rows = 1, cols = 720 . Reduce the function in OpenCV but when I mat.at < Int & gt; (0, i) , then always claims that the file failed in the Fix Catechin at line 537 in the function in mat.hpp:

 < Code> Template & lt; Typename _Tp & gt; Inline _Tp & amp; Mat :: at (int i0, int i1) {cv_DbgAssert (dims & lt; = 2 & amp; and (unsigned) i0 <(unsigned) size [0] Unsigned) (I1 * DataType & lt; _Tp & gt;: Channel) & lt; (unsigned) (size p [1] * channel ()) & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; _mail_sIS1; 1 (datatype & lt; _Tp & gt; depth) == elemSize1 ()); Return ((_Tp *) (Data + step .p [0] * i0)) [i1]; }   

How to do it? Thank you.

If cv :: MAT is 1 dimensional (i.e. only one of its dimensions is larger) Just mat.at & lt; Int & gt; (I)

, but still the most likely reason is that the mat type is not int, as suggested by Skyschach.

No comments:

Post a Comment