I would like to initialize the 3 × 3 kernel matrix and use it to expand the image in OpenCV4Android. In native C ++ OpenCV, you would do:
Mat kernel = (Mat_<int>(3,3) << 0,1,0,1,1,1,0,1,0); dilate(image, image, kernel);
but how can I do the equivalent of the first line in Java? A mat cannot be considered as an array, and Java does not have a <<<operator. There seems to be an OpenCV function cvCreateStructuringElementEx that initializes Mats for use as kernels, but I cannot find this function in OpenCV4Android.
Thank you very much.
source share