Initialize Mat with type CV_8UC1 from array
Hi guys, i tried to initialize my Mat variable which size is 4 x 9. Here is my code :
int dummy_query_data[36] = {
255, 0, 255, 255,255,255,0,255,255,
255,0,0,255,255,255,255,255,255,
255,0,0,255,255,255,0,255,255,
255,0,0,255,255,255,255,255,255
};
Mat C = Mat(4,9,CV_8UC1,dummy_query_data);
But when i print it to the console using
cout << "C = "<< endl << " "<< C << endl;
It gives incorrect result
C =
[255, 0, 0, 0, 0, 0, 0, 0, 255;
0, 0, 0, 255, 0, 0, 0, 255, 0;
0, 0, 255, 0, 0, 0, 0, 0, 0;
0, 255, 0, 0, 0, 255, 0, 0, 0]
Any solution regarding this ? thanks.