Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

it's a simple type error. your x is unsigned int, while you treat the Mat as unsigned short.

there is no support for unsigned int in opencv, so you're gonna need:

int size = 3;
static unsigned short x[3][3];
...
cv::Mat A(size,size, CV_16U,x);

it's a simple type error. your x is unsigned int, while you treat the Mat as unsigned short.

there is no support for unsigned int in opencv, so you're gonna need:

int size = 3;
static unsigned short x[3][3];
...
cv::Mat A(size,size, CV_16U,x);
// and careful here, A is only valid as long as x stays in scope !