Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Convert RGBA byte buffer to OpenCV image?

I have a byte buffer (unsigned char) of RGBA format, I wish to use this image data in OpenCV, use it as a IplImage. How to convert from this byte buffer to IplImage*?

Convert RGBA byte buffer to OpenCV image?

I have a byte buffer (unsigned char( unsigned char * ) of RGBA format, I wish to use this image data in OpenCV, use it as a IplImage. How to convert from this byte buffer to IplImage*?IplImage?

Convert RGBA byte buffer to OpenCV image?

I have a byte buffer ( unsigned char * ) of RGBA format, I wish to use this image data in OpenCV, use it as a IplImage. How to convert from this byte buffer to IplImage?

Think I have worked this out myself, still testing.

IplImage* img = cvCreateImage( cvSize(width,height), IPL_DEPTH_8U, 4);
cvSetData(img, buffer, width*4);

Convert RGBA byte buffer to OpenCV image?

I have a byte buffer ( unsigned char * ) of RGBA format, I wish to use this image data in OpenCV, use it as a IplImage. How to convert from this byte buffer to IplImage?

Think I have worked this out myself, still testing.

IplImage* img = cvCreateImage( cvSize(width,height), IPL_DEPTH_8U, 4);
cvSetData(img, buffer, width*4);