OPENCV 用二维数组初始化Mat

float a[12][11];
float b[12];
Mat A = Mat (2*g_maxCornerNumber,11, CV_64F,a);
Mat B = Mat (2*g_maxCornerNumber,1, CV_64F,b);

for( int i = 0; i {
a[2*i][0] = a[2*i+1][4] =vec3D[i].x;
a[2*i][1] = a[2*i+1][5] =vec3D[i].y;
a[2*i][2] = a[2*i+1][6] =vec3D[i].z;
a[2*i][3] = a[2*i][7] = 1;
a[2*i][4] = a[2*i][5] = a[2*i][6] =a[2*i][7]=a[2*i+1][0]=a[2*i+1][1]=a[2*i+1][2]=a[2*i+1][3]=0;
a[2*i][8] = -vec3D[i].x*corners[i].x;
a[2*i][9] = -vec3D[i].y*corners[i].x;
a[2*i][10] = -vec3D[i].z*corners[i].x;
a[2*i+1][8] = -vec3D[i].x*corners[i].y;
a[2*i+1][9] = -vec3D[i].y*corners[i].y;
a[2*i+1][10] = -vec3D[i].z*corners[i].y;
b[2*i]=corners[i].x;
b[2*i+1]=corners[i].y;
}
cout cout cout cout corners是vector类型;
vec是自己定义的存放点的三维世界坐标的类型;
这是初始化的代码,可是输出的全是乱码,是怎么回事,求大神指点!

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问