Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

As it happens, yes. This is not really the kind of question this forum answers, but I happen to know.

Or, really, you could have googled it, because the first result has this code:

cv::Mat workImage;
PvImage* lImage = lBuffer->GetImage();
lImage->Alloc(lWidth, lHeight, PvPixelRGB8);
// Get image data pointer so we can pass it to CV::MAT container
unsigned char *img = lImage->GetDataPointer();
// Copy/convert Pleora Vision image pointer to cv::Mat container
cv::Mat lframe(lHeight, lWidth, CV_8UC3, img); 
lframe.copyTo(workImage);

I don't know about the call to Alloc, that may not be necessary depending on your use case. What this code does is copy the contents of the PvBuffer to the cv::Mat workImage.