Ask Your Question
0

imageData and depth from a Mat Object

asked 2013-03-11 02:22:11 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

Hi All,

I have a code snippet which uses OpenCV's C interface.
The code uses IplImage* and obtains its imageData, widthStep and depth.
Now, We are modifying our code to use C++ based interface and Mat class.
Could you please tell me how to obtain imageData, widthStep and depth from a Mat object?

Thanks,
Soaptechie

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-03-11 02:45:02 -0600

The data are in public 'data' field, the depth could be accessed through:

int depth() const;

for 'widthStep', the field 'step[0]' should be what your looking for...

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-03-11 02:22:11 -0600

Seen: 1,647 times

Last updated: Mar 11 '13