How to browse a Matrix returned by the OpenCV2.0 Canny() function ?

Posted by user290613 on Stack Overflow See other posts from Stack Overflow or by user290613
Published on 2010-03-23T08:59:00Z Indexed on 2010/03/23 9:03 UTC
Read the original article Hit count: 342

Filed under:
|
|

Hi all,

I've been browsing the web to get an answer but no way to put my hand on it.

I call the Canny function that fills me a matrix

Canny(src, dst, 220, 299, 3 );

the dst variable is now a Matrix that is according to me of type CV_8UC1, 8bit, 1channel.

Now I would like to browse this matrix according to rows and columns, so there was a trick that I've seen on stackoverflow

dst.at<uchar*>(3, 5)

In my case it crashes. (Assertion Failed, unknown function, cxmat.hpp line 450)

My matrix information are

myMatrix.width() = 181
myMatrix.height() = 65

One more thing, when I do

std::cout << dst.depth() << std::endl;

It always retrieves me 0 and not 8 (which I guess Im suppose to get)

Thank you very much for all who will reply,

© Stack Overflow or respective owner

Related posts about opencv

Related posts about c++