1/07/2014

(OpenCV, Mat class) Image buffer(point) copy to Mat

when you want to copy "unsigned char * pData" image buffer to Mat class in OpenCV.

This source is simple example code.

Mat InImg(height, width, CV_8UC1);
memcpy(InImg.data, pData, sizeof(unsigned char)*width*height);


3 comments: