Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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!

click to hide/show revision 2
retagged

updated 2013-10-13 02:09:42 -0600

berak gravatar image

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!