mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-22 01:11:40 +00:00
Help more with memory usage in speckle reject and draw pipes
This commit is contained in:
@@ -57,6 +57,7 @@ public class Draw2dContoursPipe implements Pipe<Pair<Mat, List<StandardCVPipelin
|
||||
|
||||
drawnContours.forEach(Mat::release);
|
||||
drawnContours.clear();
|
||||
drawnContours = new ArrayList<>();
|
||||
|
||||
r.points(vertices);
|
||||
contour.fromArray(vertices);
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.chameleonvision.vision.pipeline.pipes;
|
||||
|
||||
import com.chameleonvision.vision.pipeline.Pipe;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfPoint;
|
||||
import org.opencv.core.MatOfPoint2f;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -26,7 +28,9 @@ public class SpeckleRejectPipe implements Pipe<List<MatOfPoint>, List<MatOfPoint
|
||||
public Pair<List<MatOfPoint>, Long> run(List<MatOfPoint> input) {
|
||||
long processStartNanos = System.nanoTime();
|
||||
|
||||
despeckledContours.forEach(MatOfPoint::release);
|
||||
despeckledContours.clear();
|
||||
despeckledContours = new ArrayList<>();
|
||||
|
||||
if (input.size() > 0) {
|
||||
double averageArea = 0.0;
|
||||
|
||||
Reference in New Issue
Block a user