Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You could try to create a Mat with cv::Mat(int rows, int cols, int type, void* data, size_t step=AUTO_STEP) and cvtColor to convert it then.

cv::Mat input(rows, cols, CV_8UC1, buffer);
cv::Mat converted
cv::cvtColor(input, converted, CV_YUV2RGBA_YV12);

Im not completely sure if assuming that the buffer is an 8bit unsigned char image will work, but you could give it a try.

You could try to create a Mat with cv::Mat(int rows, int cols, int type, void* data, size_t step=AUTO_STEP) and cvtColor to convert it then.

cv::Mat input(rows, cols, CV_8UC1, buffer);
cv::Mat converted
converted;
cv::cvtColor(input, converted, CV_YUV2RGBA_YV12);

Im not completely sure if assuming that the buffer is an 8bit unsigned char image will work, but you could give it a try.

You could try to create a Mat with cv::Mat(int rows, int cols, int type, void* data, size_t step=AUTO_STEP) and cvtColor to convert it then.

cv::Mat input(rows, cols, CV_8UC1, buffer);
cv::Mat converted;
cv::cvtColor(input, converted, CV_YUV2RGBA_YV12);
CV_YUV2RGB_YV12);

Im not completely sure if assuming that the buffer is an 8bit unsigned char image will work, but you could give it a try.