Ask Your Question
0

cvMat data size

asked 2013-09-24 11:15:27 -0500

drKzs gravatar image

updated 2013-09-24 11:28:30 -0500

berak gravatar image

Hello,

Sorry if the question has been asked already, but i'm not sure of the simple answer : how to determine the cv::Mat data field size ?

I've read this page : link text

So rows*step is enough, no need to take care of elemSize or depth ?

Thanx a lot :)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2013-09-24 14:59:17 -0500

Moster gravatar image

updated 2013-09-24 15:00:39 -0500

The simplest way I know is:

int bytes = Mat.total() * Mat.elemSize();

The Mat.total() returns rows x cols and Mat.elemSize() returns channels x sizeof(type)

edit flag offensive delete link more

Comments

ok, thanx :)

drKzs gravatar imagedrKzs ( 2013-09-25 09:40:49 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-09-24 11:15:27 -0500

Seen: 5,121 times

Last updated: Sep 24 '13