First time here? Check out the FAQ!
answered 2014-11-26 17:13:55 -0600
Use this:
MatOfPoint2f idx = new MatOfPoint2f(); Core.findNonZero(mask, idx); idx.convertTo(idx, CvType.CV_32FC2); RotatedRect box = Imgproc.minAreaRect(idx);