Ask Your Question
3

How to use Mat.at<Internal type>(i,j)?

asked Jul 8 '13

How can I use element in Mat by at function without specifying its type.

sample:

Mat.at(i,j) == if (Mat.type == CV_8U) --> Mat.at<unsigned char>(i,j)

Mat.at(i,j) == if (Mat.type == CV_32F) --> Mat.at<float>(i,j)
Preview: (hide)

1 answer

Sort by » oldest newest most voted
3

answered Jul 9 '13

jbseano gravatar image

You can use Mat_. You have to specify the Mat_ type when you declare it, and then you can acces to the pixels easily.

Check this documentation: http://docs.opencv.org/modules/core/doc/basic_structures.html#id7

Preview: (hide)

Question Tools

Stats

Asked: Jul 8 '13

Seen: 56,920 times

Last updated: Jul 09 '13