I am trying to get an image from the Kinect and use it in OpenCV. I get the image I need from the Kinect manager like so:
kinIm = manager.GetUsersLblTex();
This works. I can set a material’s mainTexture property and see it. Then I try and make a new Mat using the image data:
kinMat = new Mat(kinIm.width, kinIm.height, CvType.CV_8UC4);
And then try to convert the texture to Mat - this fails and tells me the output Mat object has to be of the same size.
Utils.textureToMat(kinIm, kinMat);
I assume it’s the color setting but the docs say it has to 8UC1, 3 or 4 and all of them generate the same error.
Hints?