Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

If you want to use existing buffer without copping it use:

Mat(rows, cols, CV_16U, your_buffer, stride_of_buffer);

It will create Mat that will contain your buffer. Note that Mat won't take the responsibility of releasing it, you will have to do that yourself.

If you want to use existing buffer without copping it use:

Mat(rows, cols, CV_16U, your_buffer, stride_of_buffer);

It will create Mat that will contain your buffer. Note that Mat won't take the responsibility of releasing it, you will have to do that yourself.yourself. This just a wrapper for your data, no data is copied.

It doesn't really matter if the buffer is part of video or something else.

And the last parameter is optional (stride_of_buffer). You don't need it your buffer is continuous in memory.

If you want to use existing buffer without copping it use:

Mat(rows, cols, CV_16U, your_buffer, stride_of_buffer);

It will create Mat that will contain your buffer. Note that Mat won't take the responsibility of releasing it, you will have to do that yourself. This just a wrapper for your data, no data is copied.

It doesn't really matter if the buffer is part of video or something else.

And the last parameter is optional (stride_of_buffer). You don't need it if your buffer is continuous in memory.