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