Open-CV 2.4 Android-Java:
I searched for outlines (MatofPoint list) as follows:
Imgproc.findContours(roi_mat, contours, hierarchy, cfg.retMode, cfg.apxMode);
and then a convex element (there should be a MatofInt list)
for (int k=0; k < contours.size(); k++){ Imgproc.convexHull(contours.get(k), hull.get(k)); }
The graduation housing wants MatofInt, but drawcontours wants MatofPoint. So what to do?
thanks in advance..
Edit : @ OpenCV4Android
for (int k=0; k < contours.size(); k++){ Imgproc.convexHull(contours.get(k), hullInt); for(int j=0; j < hullInt.toList().size(); j++){ hullPointList.add(contours.get(k).toList().get(hullInt.toList().get(j))); } hullPointMat.fromList(hullPointList); hullPoints.add(hullPointMat); } Imgproc.drawContours( mROI, hullPoints, -1, new Scalar(255,0,0, 255), 1);
ddd
source share