Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Use this:

MatOfPoint2f idx = new MatOfPoint2f();
Core.findNonZero(mask, idx);
idx.convertTo(idx, CvType.CV_32FC2);
RotatedRect box = Imgproc.minAreaRect(idx);