1
2
3
4
5
6
7
8
9
10
| IplImage *Yuv2IplImage(char *yuv, int imgWidth, int imgHeight)
{
cv::Mat matYUV(imgHeight * 3 / 2, imgWidth, CV_8UC1, yuv);
cv::Mat matBGR;
cv::cvtColor(matYUV, matBGR, cv::COLOR_YUV2BGR_NV12);
IplImage imgTmp = matBGR;
IplImage *img = cvCloneImage(&imgTmp);
return img;
} |
IplImage *Yuv2IplImage(char *yuv, int imgWidth, int imgHeight)
{
cv::Mat matYUV(imgHeight * 3 / 2, imgWidth, CV_8UC1, yuv);
cv::Mat matBGR;
cv::cvtColor(matYUV, matBGR, cv::COLOR_YUV2BGR_NV12);
IplImage imgTmp = matBGR;
IplImage *img = cvCloneImage(&imgTmp);
return img;
}