diff --git a/chameleon-server/src/main/java/com/chameleonvision/vision/pipeline/pipes/GroupContoursPipe.java b/chameleon-server/src/main/java/com/chameleonvision/vision/pipeline/pipes/GroupContoursPipe.java index 42cfd6d96..78639ffc1 100644 --- a/chameleon-server/src/main/java/com/chameleonvision/vision/pipeline/pipes/GroupContoursPipe.java +++ b/chameleon-server/src/main/java/com/chameleonvision/vision/pipeline/pipes/GroupContoursPipe.java @@ -23,6 +23,8 @@ public class GroupContoursPipe implements Pipe, List groupedContours = new ArrayList<>(); private MatOfPoint2f intersectMatA = new MatOfPoint2f(); private MatOfPoint2f intersectMatB = new MatOfPoint2f(); @@ -54,10 +56,9 @@ public class GroupContoursPipe implements Pipe, List { - MatOfPoint2f contour = new MatOfPoint2f(); - contour.fromArray(c.toArray()); - if (contour.cols() != 0 && contour.rows() != 0) { - RotatedRect rect = Imgproc.minAreaRect(contour); + contourBuffer.fromArray(c.toArray()); + if (contourBuffer.cols() != 0 && contourBuffer.rows() != 0) { + RotatedRect rect = Imgproc.minAreaRect(contourBuffer); var target = new StandardCVPipeline.TrackedTarget(); target.minAreaRect = rect; groupedContours.add(target); @@ -83,11 +84,10 @@ public class GroupContoursPipe implements Pipe, List