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.
2 | No.2 Revision |
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.
3 | No.3 Revision |
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.