I am trying to read the raw YUV 4:2:2 (720p) data from the Read buffer, I mapped the physical address of the Read buffer to the virtual address.
mem is a pointer which is pointing to Read buffer base address. I tried with below below-mentioned code but it is returning the empty image, please can anybody help me to read the Raw YUV 4:2:2 format image data from the memory.
I have tried below-mentioned code, but i is returning empty image
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();