Ask Your Question
3

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

asked 2013-07-08 03:10:10 -0600

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)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2013-07-09 02:27:57 -0600

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

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-07-08 03:10:10 -0600

Seen: 56,715 times

Last updated: Jul 09 '13