Imgproc.minEnclosingTriangle from Java [closed]
I'm using opencv-400.jar and I'm trying to call the method minEnclosingTriangle in the following way.
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
Mat points = Mat.zeros(4, 2, CvType.CV_32F);
points.put(1, 0, 1);
points.put(2, 1, 1);
points.put(3, 0, 1);
points.put(3, 1, 1);
Mat triangle = Mat.zeros(3, 2, CvType.CV_32F);
Imgproc.minEnclosingTriangle(points, triangle);
This results in an error: (-215:Assertion failed) channels() == CV_MAT_CN(dtype) in function 'cv::Mat::copyTo'. Apparently it originates from here: https://github.com/opencv/opencv/blob.... How should I set up 'triangle' to make this work? Thanks in advance.