2013-04-18 84 views

回答

0

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]; 
} 
相關問題