Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. private void approximation(int counter) {
  2.         MatOfPoint2f approx = new MatOfPoint2f();
  3.         MatOfPoint2f approxCurve = new MatOfPoint2f();
  4.         approxContours = hullmop;
  5.         for (int i = 0; i < counter; i++) {
  6.             hullmop.get(i).convertTo(approx, CvType.CV_32FC2);
  7.             double approxDistance = Imgproc.arcLength(approx, true) * 0.0001;
  8.             Imgproc.approxPolyDP(approx, approxCurve, approxDistance, true);
  9.             approxCurve.convertTo(approxContours.get(i), CvType.CV_32S);
  10.         }
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement