mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-20 00:51:41 +00:00
Fix videomode change on pipeline change, more memory leak hunting
This commit is contained in:
@@ -258,6 +258,7 @@ public class VisionProcess {
|
||||
try {
|
||||
streamFrameQueue.clear();
|
||||
streamFrameQueue.add(lastPipelineResult.outputMat);
|
||||
camFrame.release();
|
||||
} catch (Exception e) {
|
||||
Debug.printInfo("Vision running faster than stream.");
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ public abstract class CVPipeline<R extends CVPipelineResult, S extends CVPipelin
|
||||
|
||||
public void initPipeline(CameraCapture camera) {
|
||||
cameraCapture = camera;
|
||||
cameraCapture.setVideoMode(settings.videoModeIndex);
|
||||
cameraCapture.setExposure((int) settings.exposure);
|
||||
cameraCapture.setBrightness((int) settings.brightness);
|
||||
cameraCapture.setGain((int) settings.gain);
|
||||
|
||||
@@ -7,16 +7,16 @@ import java.util.List;
|
||||
public abstract class CVPipelineResult<T> {
|
||||
public final List<T> targets;
|
||||
public final boolean hasTarget;
|
||||
public final Mat outputMat;
|
||||
public final Mat outputMat = new Mat();
|
||||
public final long processTime;
|
||||
public long imageTimestamp = 0;
|
||||
|
||||
public CVPipelineResult(List<T> targets, Mat outputMat, long processTime) {
|
||||
this.targets = targets;
|
||||
hasTarget = targets != null && !targets.isEmpty();
|
||||
this.outputMat = outputMat;
|
||||
// outputMat.copyTo(this.outputMat);
|
||||
// outputMat.release();
|
||||
// this.outputMat = outputMat;
|
||||
outputMat.copyTo(this.outputMat);
|
||||
outputMat.release();
|
||||
this.processTime = processTime;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user