mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-04 03:11:40 +00:00
Update TODOs, minor cleanups, add ledMode to pipelinesettings
This commit is contained in:
@@ -76,7 +76,7 @@ public class ScriptManager {
|
||||
|
||||
// protected static final Path scriptConfigPath =
|
||||
// Paths.get(ConfigManager.SettingsPath.toString(), "scripts.json");
|
||||
static final Path scriptConfigPath = Paths.get(""); // TODO: FIX
|
||||
static final Path scriptConfigPath = Paths.get(""); // TODO: Waiting on config
|
||||
|
||||
private ScriptConfigManager() {}
|
||||
|
||||
|
||||
@@ -61,9 +61,8 @@ public enum Platform {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// TODO: better way to do this?
|
||||
while (!shell.isOutputCompleted()) {
|
||||
// ignored
|
||||
// TODO: add timeout
|
||||
}
|
||||
|
||||
if (shell.getExitCode() == 0) {
|
||||
|
||||
@@ -49,7 +49,6 @@ public class FileUtils {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
// TODO file perms on Windows
|
||||
logger.info("Cannot set directory permissions on Windows!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,9 +50,7 @@ public class CVShape {
|
||||
break;
|
||||
case Triangle:
|
||||
break;
|
||||
case Square:
|
||||
break;
|
||||
case Rectangle:
|
||||
case Quadrilateral:
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -144,7 +144,7 @@ public class Contour implements Releasable {
|
||||
return isIntersecting;
|
||||
}
|
||||
|
||||
// TODO: refactor to do "infinite" contours
|
||||
// TODO: refactor to do "infinite" contours ???????
|
||||
public static Contour groupContoursByIntersection(
|
||||
Contour firstContour, Contour secondContour, ContourIntersectionDirection intersection) {
|
||||
if (areIntersecting(firstContour, secondContour, intersection)) {
|
||||
|
||||
@@ -4,8 +4,7 @@ public enum ContourShape {
|
||||
Custom(-1),
|
||||
Circle(0),
|
||||
Triangle(3),
|
||||
Square(4),
|
||||
Rectangle(4);
|
||||
Quadrilateral(4);
|
||||
|
||||
public final int sides;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class Draw2dCrosshairPipe
|
||||
}
|
||||
break;
|
||||
case Dual:
|
||||
// TODO
|
||||
// TODO: draw crosshair based on dual calibration
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,6 @@ import org.opencv.imgproc.Imgproc;
|
||||
public class Draw3dTargetsPipe
|
||||
extends CVPipe<Pair<Mat, List<TrackedTarget>>, Mat, Draw3dTargetsPipe.Draw3dContoursParams> {
|
||||
|
||||
private static MatOfPoint tempMat = new MatOfPoint();
|
||||
|
||||
@Override
|
||||
protected Mat process(Pair<Mat, List<TrackedTarget>> in) {
|
||||
for (var target : in.getRight()) {
|
||||
|
||||
@@ -30,9 +30,6 @@ public class GroupContoursPipe
|
||||
int groupingCount = params.getGroup().count;
|
||||
|
||||
if (input.size() > groupingCount) {
|
||||
// todo: is it OK to mutate the input list?
|
||||
// or should we clone it like before?
|
||||
// what is the perf hit on cloning?
|
||||
input.sort(Contour.SortByMomentsX);
|
||||
// also why reverse? shouldn't the sort comparator just get reversed?
|
||||
Collections.reverse(input);
|
||||
|
||||
@@ -6,8 +6,14 @@ import com.chameleonvision.common.vision.opencv.ContourSortMode;
|
||||
import com.chameleonvision.common.vision.target.RobotOffsetPointMode;
|
||||
import com.chameleonvision.common.vision.target.TargetOffsetPointEdge;
|
||||
import com.chameleonvision.common.vision.target.TargetOrientation;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
public class AdvancedPipelineSettings extends CVPipelineSettings {
|
||||
|
||||
public AdvancedPipelineSettings() {
|
||||
ledMode = true;
|
||||
}
|
||||
|
||||
public IntegerCouple hsvHue = new IntegerCouple(50, 180);
|
||||
public IntegerCouple hsvSaturation = new IntegerCouple(50, 255);
|
||||
public IntegerCouple hsvValue = new IntegerCouple(50, 255);
|
||||
|
||||
@@ -15,7 +15,6 @@ public class CVPipelineResult implements Releasable {
|
||||
this.processingMillis = processingMillis;
|
||||
this.targets = targets;
|
||||
|
||||
// TODO: is this the best way to go about this?
|
||||
this.outputFrame = Frame.copyFrom(outputFrame);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,4 +16,5 @@ public class CVPipelineSettings {
|
||||
public int cameraVideoModeIndex = 0;
|
||||
public FrameDivisor inputFrameDivisor = FrameDivisor.NONE;
|
||||
public FrameDivisor outputFrameDivisor = FrameDivisor.NONE;
|
||||
public boolean ledMode = false;
|
||||
}
|
||||
|
||||
@@ -63,8 +63,8 @@ public class ReflectivePipeline extends CVPipeline<CVPipelineResult, ReflectiveP
|
||||
|
||||
ErodeDilatePipe.ErodeDilateParams erodeDilateParams =
|
||||
new ErodeDilatePipe.ErodeDilateParams(
|
||||
settings.erode, settings.dilate, 5); // TODO: add kernel size to
|
||||
// pipeline settings
|
||||
settings.erode, settings.dilate, 5);
|
||||
// TODO: add kernel size to pipeline settings
|
||||
erodeDilatePipe.setParams(erodeDilateParams);
|
||||
|
||||
HSVPipe.HSVParams hsvParams =
|
||||
@@ -75,7 +75,6 @@ public class ReflectivePipeline extends CVPipeline<CVPipelineResult, ReflectiveP
|
||||
new OutputMatPipe.OutputMatParams(settings.outputShowThresholded);
|
||||
outputMatPipe.setParams(outputMatParams);
|
||||
|
||||
// TODO: necessary? offer different contour methods?
|
||||
FindContoursPipe.FindContoursParams findContoursParams =
|
||||
new FindContoursPipe.FindContoursParams();
|
||||
findContoursPipe.setParams(findContoursParams);
|
||||
|
||||
@@ -35,7 +35,7 @@ public class VisionModule {
|
||||
}
|
||||
|
||||
void consumeResult(CVPipelineResult result) {
|
||||
// TODO: put result in to Data
|
||||
// TODO: put result in to Data (not this way!)
|
||||
var data = new Data();
|
||||
data.result = result;
|
||||
consumeData(data);
|
||||
|
||||
@@ -10,7 +10,6 @@ import org.opencv.core.MatOfPoint2f;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.core.RotatedRect;
|
||||
|
||||
// TODO: banks fix
|
||||
public class TrackedTarget implements Releasable {
|
||||
public final Contour m_mainContour;
|
||||
List<Contour> m_subContours; // can be empty
|
||||
|
||||
@@ -45,7 +45,6 @@ public class FileFrameProviderTest {
|
||||
assertEquals(320, goodFrameCols);
|
||||
assertEquals(240, goodFrameRows);
|
||||
|
||||
// TODO: find a way to skip this if a flag isn't set
|
||||
TestUtils.showImage(goodFrame.image.getMat(), "2019");
|
||||
|
||||
var badFilePath = Paths.get("bad.jpg"); // this file does not exist
|
||||
@@ -78,7 +77,6 @@ public class FileFrameProviderTest {
|
||||
assertEquals(640, goodFrameCols);
|
||||
assertEquals(480, goodFrameRows);
|
||||
|
||||
// TODO: find a way to skip this if a flag isn't set
|
||||
TestUtils.showImage(goodFrame.image.getMat(), "2020");
|
||||
|
||||
var badFilePath = Paths.get("bad.jpg"); // this file does not exist
|
||||
|
||||
Reference in New Issue
Block a user