Mat_<uchar> translation in java, dilating
Hello, im trying to translate this c++ code to java Mat kernel = (Mat_<uchar>(3,3) << 0,1,0,1,1,1,0,1,0); dilate(outerBox, outerBox, kernel);
i figured up the dilate part, but i can't do the same with the Mat kernel object, i know that line is intended to create a 3x3 matrix of unsigned characters and fil it with 0,1,0,1,1,1,0,1,0 but i can't come up with the java equivalent of the Mat_<uchar> class, and i can't figure out how to assign 0,1,0,1,1,1,0,1,0 this vector to the matrix object
thanks in advance!
byte [] data = {0,1,0,1,1,1,0,1,0}; Mat kernel = new Mat(3,3,CvType.CV_8U); kernel.put(0,0,data);
thanks a lot, that solved it, although i solved it by creating a 3x3 CV_8u matrix and putting the numbers one by one, you approach is much more elegant.