【发布时间】:2019-08-19 14:21:16
【问题描述】:
我正在尝试从读取缓冲区读取原始 YUV 4:2:2 (720p) 数据,我将读取缓冲区的物理地址映射到虚拟地址。
mem 是一个指向读取缓冲区基地址的指针。我尝试使用下面提到的代码,但它返回的是空图像,请谁能帮我从内存中读取 Raw YUV 4:2:2 格式的图像数据。
我已经尝试过下面提到的代码,但我返回的是空图像
cv::Mat img(1,1280 , numCols,CV_8U1, mem);
//mem -> mem is a pointer to Read buffer which have raw YUV 4:2:2 image data .
//len-> Frame resolution (1280 * 720 * 3) (720p)
if (img.empty())
{
cout << "Image is not loaded" << endl;
return 0;
}
cv::imshow("img",img);
cv::waitKey();
【问题讨论】:
-
我不清楚您是否在内存中的某个地方有一些图像数据要加载到 OpenCV Mat 中,或者您有一个 OpenCV Mat 并且您正试图将数据从中复制到另一个缓冲区。
-
我在内存中有一些图像 YUV 4:2:2 数据,我想将此图像数据加载到格式为 BGR 的 opencv Mat 中。
标签: c++ opencv opencv3.0 opencv3.1