My camera outputs data in the form byte[] and I can get to a black and white image. But, I need to convert to Mat color. My attempt gets me the error message above. Is there a different method? Working code.
byte[] Still;
Insten.grabFrame(Still);
YUYVImage BlackWhiteImage;
BlackWhiteImage = new YUYVImage(Still, WIDTH, HEIGHT);
Code I need to work.
byte[] Still;
Insten.grabFrame(Still);
if(Still.length == HEIGHT * WIDTH * 3)
{ Mat cvyuv = new Mat(HEIGHT, WIDTH, CvType.CV_8UC1, Still);
Mat cvbgr = new Mat();
Imgproc.cvtColor(cvyuv, cvbgr, Imgproc.COLOR_YUV2BGR);
}