Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 OpenCv 将字节数组转换为 IplImage?
是否可以使用 Opencv 在此处从字节数组转换为 IplImage ?
简称
uchar mybytes[]={1,255,0,4,1,4,76,43,45}; Mat mymat(3,3,CV_8UC1,mybytes);
或分析
int nl= mymat.rows; int nc= mymat.cols; for (int j=0; j<nl; j++) { uchar* data= mymat.ptr<uchar>(j); for (int i=0; i<nc; i++) data[i]= mybytes[j*i]; }