ColorConversion problem (RGB565 to RGB)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

ColorConversion problem (RGB565 to RGB)

Matthias Schmieder
I kind of stuck at a problem with the conversion from one colorspace to another.

The main problem is, that I have a buffer that contains 16bit rgb values and want to add it to a cv::Mat template.

short* pBuffer = new short[640*480];
GetDigiCamFrame(pBuffer); // some function of mine

Now what I want to do, is to give this buffer to a cv::Mat structure and then convert it to RGB. But since I don't know which template I have to use I'm kind of stuck.
I tried the following

cv::Mat_<short> a(480,640,pBuffer);
cv::Mat dst;

but this won't work at all. Has anybody an idea how to do this? What template of the cv:Mat object do I have to use?

Thanks all for your help!