Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Buffer to Mat

Hello guys,

I need your help.

I work with two cameras with a resolution of 4000x3000. Because of USB3 Vision I can only access with the manufacturer api on pictures.

As return value I get a pointer

void*                    BufferCam = NULL;
Strm_ReadCurrentImage(mStrmCam, BufferCam, &uiPyldSize, &sImageInfo);

Now I want to write the data into a cv Mat like this

Mat mCam= Mat(3000, 4000, CV_8UC3, BufferCam, Mat::AUTO_STEP);

Unfortunately my matrix keep empty. If I change size of the rows and cols like this

Mat mCam= Mat(1080, 1920, CV_8UC3, BufferCam, Mat::AUTO_STEP);

it work, but the image is understandably garbage.

image description