Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you don't need 2 rows in your points Mat, but 2 channels, like:

Mat points = Mat.zeros(4, 1, CvType.CV_32FC2);      
points.put(0, 0, 0,0);
points.put(1, 0, 1,0);
points.put(2, 0, 0,1);
points.put(3, 0, 1,1);    
Mat triangle = new Mat();
Imgproc.minEnclosingTriangle(points, triangle);

you don't need 2 rows cols in your points Mat, but 2 channels, like:

Mat points = Mat.zeros(4, 1, CvType.CV_32FC2);      
points.put(0, 0, 0,0);
points.put(1, 0, 1,0);
points.put(2, 0, 0,1);
points.put(3, 0, 1,1);    
Mat triangle = new Mat();
Imgproc.minEnclosingTriangle(points, triangle);