Code for operating my camera is giving me images as signed 32-bit integers, and I would like to turn this into an openCV Mat.
When I have 16-bit signed integers, I do the following:
int16_t x[100][100];
Mat A(100, 100, CV_16SC1, x);
imshow("BLAH", A);
This works. Similarly, when I have 8-bit unsigned integers I use uint8_t and CV_8UC1 and it works. I can also use double and CV_64FC1 and it works. Sadly, the following does not work:
int32_t x[100][100];
Mat A(100, 100, CV_32SC1, x);
imshow("BLAH", A);
OpenCV throws a -215:Assertion failed exception on the imshow line, indicating the Mat was not properly loaded in the first place (I think). I have also tried using int instead of int32_t, but to no avail.