把YUV灰度图转化成opencv中的Mat格式的两行代码备份

1 cv::Mat cv_img;
2 cv::Mat cv_yuv(height, width, CV_8UC1, pFrame);//pFrame为YUV数据地址
3 cv_img = cv::Mat(height, width, CV_LOAD_IMAGE_COLOR); 
4 cv::cvtColor(cv_yuv, cv_img, COLOR_GRAY2BGR); 

 

转载于:https://www.cnblogs.com/cumtchw/p/10999178.html

你可能感兴趣的:(人工智能)