mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-01 02:41:42 +00:00
V2.1.1 (#40)
This commit is contained in:
@@ -32,13 +32,19 @@ public class FileHelper {
|
||||
}
|
||||
|
||||
public static void setAllPerms(Path path) {
|
||||
String command = String.format("chmod 777 -R %s", path.toString());
|
||||
try {
|
||||
Process p = Runtime.getRuntime().exec(command);
|
||||
p.waitFor();
|
||||
if (!Platform.CurrentPlatform.isWindows()) {
|
||||
String command = String.format("chmod 777 -R %s", path.toString());
|
||||
try {
|
||||
Process p = Runtime.getRuntime().exec(command);
|
||||
p.waitFor();
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
// TODO file perms on Windows
|
||||
System.out.println("File permission setting not available on Windows. Not changing file permissions.");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,8 @@ public class VisionManager {
|
||||
VideoCapture cap = new VideoCapture(info.dev);
|
||||
if (cap.isOpened()) {
|
||||
cap.release();
|
||||
String name = info.name;
|
||||
// Filter non-ascii characters because ext4 doesn't play nice with unicode in directory names
|
||||
String name = info.name.replaceAll("[^\\x00-\\x7F]", "");
|
||||
while (usbCameraInfosByCameraName.containsKey(name)) {
|
||||
suffix++;
|
||||
name = String.format("%s (%d)", name, suffix);
|
||||
|
||||
@@ -24,7 +24,6 @@ import edu.wpi.first.wpilibj.geometry.Pose2d;
|
||||
import edu.wpi.first.wpiutil.CircularBuffer;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.opencv.core.Mat;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -36,7 +35,7 @@ import java.util.stream.Collectors;
|
||||
public class VisionProcess {
|
||||
|
||||
private final USBCameraCapture cameraCapture;
|
||||
private final CameraStreamerRunnable streamRunnable;
|
||||
// private final CameraStreamerRunnable streamRunnable;
|
||||
private final VisionProcessRunnable visionRunnable;
|
||||
private final CameraConfig fileConfig;
|
||||
public final CameraStreamer cameraStreamer;
|
||||
@@ -73,7 +72,7 @@ public class VisionProcess {
|
||||
|
||||
// Thread to put frames on the dashboard
|
||||
this.cameraStreamer = new CameraStreamer(cameraCapture, config.cameraConfig.name, pipelineManager.getCurrentPipeline().settings.streamDivisor);
|
||||
this.streamRunnable = new CameraStreamerRunnable(30, cameraStreamer);
|
||||
// this.streamRunnable = new CameraStreamerRunnable(30, cameraStreamer);
|
||||
|
||||
// Thread to process vision data
|
||||
this.visionRunnable = new VisionProcessRunnable();
|
||||
@@ -125,7 +124,7 @@ public class VisionProcess {
|
||||
ntLatencyEntry = newTable.getEntry("latency");
|
||||
ntValidEntry = newTable.getEntry("is_valid");
|
||||
ntAuxListEntry = newTable.getEntry("aux_targets");
|
||||
ntPoseEntry = newTable.getEntry("poseList");
|
||||
ntPoseEntry = newTable.getEntry("pose");
|
||||
ntDriveModeListenerID = ntDriverModeEntry.addListener(this::setDriverMode, EntryListenerFlags.kUpdate);
|
||||
ntPipelineListenerID = ntPipelineEntry.addListener(this::setPipeline, EntryListenerFlags.kUpdate);
|
||||
ntDriverModeEntry.setBoolean(false);
|
||||
@@ -150,7 +149,11 @@ public class VisionProcess {
|
||||
*/
|
||||
private void setPipeline(EntryNotification notification) {
|
||||
var wantedPipelineIndex = (int) notification.value.getDouble();
|
||||
pipelineManager.setCurrentPipeline(wantedPipelineIndex);
|
||||
if (pipelineManager.pipelines.size() - 1 < wantedPipelineIndex) {
|
||||
ntPipelineEntry.setDouble(pipelineManager.getCurrentPipelineIndex());
|
||||
} else {
|
||||
pipelineManager.setCurrentPipeline(wantedPipelineIndex);
|
||||
}
|
||||
}
|
||||
|
||||
public void setDriverModeEntry(boolean isDriverMode) {
|
||||
@@ -177,44 +180,49 @@ public class VisionProcess {
|
||||
List<Double> center = new ArrayList<>();
|
||||
|
||||
|
||||
|
||||
if (data.hasTarget) {
|
||||
if (data instanceof StandardCVPipeline.StandardCVPipelineResult) {
|
||||
StandardCVPipeline.StandardCVPipelineResult result = (StandardCVPipeline.StandardCVPipelineResult) data;
|
||||
StandardCVPipeline.TrackedTarget bestTarget = result.targets.get(0);
|
||||
if (((StandardCVPipelineSettings) pipelineManager.getCurrentPipeline().settings).multiple) {
|
||||
for (var target : result.targets) {
|
||||
pointMap = new HashMap<>();
|
||||
pointMap.put("pitch", target.pitch);
|
||||
pointMap.put("yaw", target.yaw);
|
||||
pointMap.put("area", target.area);
|
||||
pointMap.put("pose", target.cameraRelativePose);
|
||||
try {
|
||||
if (((StandardCVPipelineSettings) pipelineManager.getCurrentPipeline().settings).multiple) {
|
||||
for (var target : result.targets) {
|
||||
pointMap = new HashMap<>();
|
||||
pointMap.put("pitch", target.pitch);
|
||||
pointMap.put("yaw", target.yaw);
|
||||
pointMap.put("area", target.area);
|
||||
pointMap.put("pose", target.cameraRelativePose);
|
||||
webTargets.add(pointMap);
|
||||
}
|
||||
} else {
|
||||
pointMap.put("pitch", bestTarget.pitch);
|
||||
pointMap.put("yaw", bestTarget.yaw);
|
||||
pointMap.put("area", bestTarget.area);
|
||||
pointMap.put("pose", bestTarget.cameraRelativePose);
|
||||
webTargets.add(pointMap);
|
||||
}
|
||||
} else {
|
||||
pointMap.put("pitch", bestTarget.pitch);
|
||||
pointMap.put("yaw", bestTarget.yaw);
|
||||
pointMap.put("area", bestTarget.area);
|
||||
pointMap.put("pose", bestTarget.cameraRelativePose);
|
||||
webTargets.add(pointMap);
|
||||
center.add(bestTarget.minAreaRect.center.x);
|
||||
center.add(bestTarget.minAreaRect.center.y);
|
||||
|
||||
} catch (ClassCastException ignored) {
|
||||
|
||||
}
|
||||
center.add(bestTarget.minAreaRect.center.x);
|
||||
center.add(bestTarget.minAreaRect.center.y);
|
||||
|
||||
} else {
|
||||
pointMap.put("pitch", null);
|
||||
pointMap.put("yaw", null);
|
||||
pointMap.put("area", null);
|
||||
pointMap.put("pose", new Pose2d());
|
||||
webTargets.add(pointMap);
|
||||
center.add(null);
|
||||
center.add(null);
|
||||
}
|
||||
} else {
|
||||
pointMap.put("pitch", null);
|
||||
pointMap.put("yaw", null);
|
||||
pointMap.put("area", null);
|
||||
pointMap.put("pose", new Pose2d());
|
||||
webTargets.add(pointMap);
|
||||
center.add(null);
|
||||
center.add(null);
|
||||
}
|
||||
|
||||
point.put("fps", visionRunnable.fps);
|
||||
point.put("targets", webTargets);
|
||||
point.put("rawPoint", center);
|
||||
point.put("fps", visionRunnable.fps);
|
||||
point.put("targets", webTargets);
|
||||
point.put("rawPoint", center);
|
||||
} else {
|
||||
point.put("fps", visionRunnable.fps);
|
||||
}
|
||||
WebSend.put("point", point);
|
||||
SocketHandler.broadcastMessage(WebSend);
|
||||
}
|
||||
@@ -233,12 +241,13 @@ public class VisionProcess {
|
||||
ntYawEntry.setDouble(targets.get(0).yaw);
|
||||
ntAreaEntry.setDouble(targets.get(0).area);
|
||||
try {
|
||||
Pose2d targetPose = targets.get(0).cameraRelativePose;
|
||||
double[] targetArray = {targetPose.getTranslation().getX(), targetPose.getTranslation().getY(), targetPose.getRotation().getDegrees()};
|
||||
ntPoseEntry.setDoubleArray(targetArray);
|
||||
// ntPoseEntry.setString(objectMapper.writeValueAsString(targets.get(0).cameraRelativePose));
|
||||
ntAuxListEntry.setString(objectMapper.writeValueAsString(targets.stream()
|
||||
.map(it -> List.of(it.pitch, it.yaw, it.area, it.cameraRelativePose))
|
||||
.collect(Collectors.toList())));
|
||||
|
||||
// TODO: (2.1) 3d stuff...
|
||||
ntPoseEntry.setString(objectMapper.writeValueAsString(targets.stream().map(target -> target.cameraRelativePose).collect(Collectors.toList())));
|
||||
} catch (JsonProcessingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -337,7 +346,7 @@ public class VisionProcess {
|
||||
// streamFrameQueue.clear();
|
||||
// streamFrameQueue.add(lastPipelineResult.outputMat);
|
||||
var currentTime = System.currentTimeMillis();
|
||||
if((currentTime - lastStreamTimeMs)/1000d > 1.0 / 30.0) {
|
||||
if ((currentTime - lastStreamTimeMs) / 1000d > 1.0 / 30.0) {
|
||||
cameraStreamer.runStream(lastPipelineResult.outputMat);
|
||||
// System.out.println("Ran stream in " + (System.currentTimeMillis() - currentTime) + "ms!");
|
||||
lastStreamTimeMs = currentTime;
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.chameleonvision.vision.enums;
|
||||
|
||||
public enum TargetOrientation {
|
||||
Portrait, Landscape
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.chameleonvision.vision.enums;
|
||||
|
||||
public enum TargetRegion {
|
||||
Center, Top, Bottom, Left, Right
|
||||
}
|
||||
@@ -20,7 +20,6 @@ public class Calibrate3dPipeline extends CVPipeline<DriverVisionPipeline.DriverP
|
||||
|
||||
private int checkerboardSquaresHigh = 7;
|
||||
private int checkerboardSquaresWide = 7;
|
||||
private MatOfPoint3f objP_ORIG;
|
||||
|
||||
private MatOfPoint3f objP;// new MatOfPoint3f(checkerboardSquaresHigh + checkerboardSquaresWide, 3);//(checkerboardSquaresWide * checkerboardSquaresHigh, 3);
|
||||
private Size patternSize = new Size(checkerboardSquaresHigh, checkerboardSquaresWide);
|
||||
@@ -45,11 +44,10 @@ public class Calibrate3dPipeline extends CVPipeline<DriverVisionPipeline.DriverP
|
||||
public Calibrate3dPipeline(StandardCVPipelineSettings settings) {
|
||||
super(settings);
|
||||
|
||||
objP_ORIG = new MatOfPoint3f();
|
||||
objP = new MatOfPoint3f();
|
||||
|
||||
for(int i = 0; i < checkerboardSquaresHigh * checkerboardSquaresWide; i++) {
|
||||
objP_ORIG.push_back(new MatOfPoint3f(new Point3(i / checkerboardSquaresWide, i % checkerboardSquaresHigh, 0.0f)));
|
||||
objP.push_back(new MatOfPoint3f(new Point3(i / checkerboardSquaresWide, i % checkerboardSquaresHigh, 0.0f)));
|
||||
}
|
||||
|
||||
setSquareSize(checkerboardSquareSizeUnits);
|
||||
|
||||
@@ -10,7 +10,9 @@ import com.chameleonvision.vision.pipeline.pipes.*;
|
||||
import edu.wpi.first.wpilibj.geometry.Pose2d;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.opencv.core.*;
|
||||
import org.opencv.core.Point;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
import static com.chameleonvision.vision.pipeline.impl.StandardCVPipeline.*;
|
||||
@@ -71,19 +73,19 @@ public class StandardCVPipeline extends CVPipeline<StandardCVPipelineResult, Sta
|
||||
speckleRejectPipe = new SpeckleRejectPipe(settings.speckle.doubleValue());
|
||||
groupContoursPipe = new GroupContoursPipe(settings.targetGroup, settings.targetIntersection);
|
||||
sortContoursPipe = new SortContoursPipe(settings.sortMode, camProps, 5);
|
||||
collect2dTargetsPipe = new Collect2dTargetsPipe(settings.calibrationMode,settings.point,settings.dualTargetCalibrationM,settings.dualTargetCalibrationB, camProps);
|
||||
collect2dTargetsPipe = new Collect2dTargetsPipe(settings.calibrationMode, settings.targetRegion, settings.targetOrientation, settings.point, settings.dualTargetCalibrationM, settings.dualTargetCalibrationB, camProps);
|
||||
draw2dContoursSettings = new Draw2dContoursPipe.Draw2dContoursSettings();
|
||||
draw2dCrosshairPipeSettings = new Draw2dCrosshairPipe.Draw2dCrosshairPipeSettings();
|
||||
|
||||
// TODO: make settable from UI? config?
|
||||
draw2dContoursSettings.showCentroid = false;
|
||||
draw2dContoursSettings.showCentroid = true;
|
||||
draw2dContoursSettings.centroidColor = new Color(25, 239, 0);
|
||||
draw2dContoursSettings.boxOutlineSize = 2;
|
||||
draw2dContoursSettings.showRotatedBox = true;
|
||||
draw2dContoursSettings.showMaximumBox = true;
|
||||
draw2dContoursSettings.showMultiple = settings.multiple;
|
||||
draw2dCrosshairPipeSettings.showCrosshair=true;
|
||||
draw2dCrosshairPipeSettings.showCrosshair = true;
|
||||
draw2dContoursPipe = new Draw2dContoursPipe(draw2dContoursSettings, camProps);
|
||||
draw2dCrosshairPipe=new Draw2dCrosshairPipe(draw2dCrosshairPipeSettings,settings.calibrationMode,settings.point,settings.dualTargetCalibrationM,settings.dualTargetCalibrationB);
|
||||
draw2dCrosshairPipe = new Draw2dCrosshairPipe(draw2dCrosshairPipeSettings, settings.calibrationMode, settings.point, settings.dualTargetCalibrationM, settings.dualTargetCalibrationB);
|
||||
outputMatPipe = new OutputMatPipe(settings.isBinary);
|
||||
}
|
||||
|
||||
@@ -124,14 +126,16 @@ public class StandardCVPipeline extends CVPipeline<StandardCVPipelineResult, Sta
|
||||
speckleRejectPipe.setConfig(settings.speckle.doubleValue());
|
||||
groupContoursPipe.setConfig(settings.targetGroup, settings.targetIntersection);
|
||||
sortContoursPipe.setConfig(settings.sortMode, camProps, 5);
|
||||
collect2dTargetsPipe = new Collect2dTargetsPipe(settings.calibrationMode,settings.point,settings.dualTargetCalibrationM,settings.dualTargetCalibrationB, camProps);
|
||||
collect2dTargetsPipe = new Collect2dTargetsPipe(settings.calibrationMode, settings.targetRegion, settings.targetOrientation, settings.point, settings.dualTargetCalibrationM, settings.dualTargetCalibrationB, camProps);
|
||||
draw2dContoursPipe.setConfig(settings.multiple, camProps);
|
||||
draw2dCrosshairPipe.setConfig(draw2dCrosshairPipeSettings,settings.calibrationMode,settings.point,settings.dualTargetCalibrationM,settings.dualTargetCalibrationB);
|
||||
draw2dCrosshairPipe.setConfig(draw2dCrosshairPipeSettings, settings.calibrationMode, settings.point, settings.dualTargetCalibrationM, settings.dualTargetCalibrationB);
|
||||
outputMatPipe.setConfig(settings.isBinary);
|
||||
|
||||
if(settings.is3D) {
|
||||
if(solvePNPPipe == null) solvePNPPipe = new SolvePNPPipe(settings, cameraCapture.getCurrentCalibrationData(), cameraCapture.getProperties().getTilt());
|
||||
if(drawSolvePNPPipe == null) drawSolvePNPPipe = new DrawSolvePNPPipe(cameraCapture.getCurrentCalibrationData());
|
||||
if (settings.is3D) {
|
||||
if (solvePNPPipe == null)
|
||||
solvePNPPipe = new SolvePNPPipe(settings, cameraCapture.getCurrentCalibrationData(), cameraCapture.getProperties().getTilt());
|
||||
if (drawSolvePNPPipe == null)
|
||||
drawSolvePNPPipe = new DrawSolvePNPPipe(cameraCapture.getCurrentCalibrationData());
|
||||
|
||||
solvePNPPipe.setConfig(settings, cameraCapture.getCurrentCalibrationData(), cameraCapture.getProperties().getTilt());
|
||||
drawSolvePNPPipe.setConfig(cameraCapture.getCurrentCalibrationData());
|
||||
@@ -179,7 +183,7 @@ public class StandardCVPipeline extends CVPipeline<StandardCVPipelineResult, Sta
|
||||
|
||||
Pair<Mat, Long> result;
|
||||
|
||||
if(!settings.is3D) {
|
||||
if (!settings.is3D) {
|
||||
// takes pair of (Mat to draw on, List<RotatedRect> of sorted contours)
|
||||
result = draw2dContoursPipe.run(Pair.of(outputMatResult.getLeft(), sortContoursResult.getLeft()));
|
||||
totalPipelineTimeNanos += result.getRight();
|
||||
@@ -188,14 +192,14 @@ public class StandardCVPipeline extends CVPipeline<StandardCVPipelineResult, Sta
|
||||
}
|
||||
|
||||
// takes pair of (Mat to draw on, List<RotatedRect> of sorted contours)
|
||||
Pair<Mat, Long> draw2dCrosshairResult = draw2dCrosshairPipe.run(Pair.of(result.getLeft(),collect2dTargetsResult.getLeft()));
|
||||
Pair<Mat, Long> draw2dCrosshairResult = draw2dCrosshairPipe.run(Pair.of(result.getLeft(), collect2dTargetsResult.getLeft()));
|
||||
totalPipelineTimeNanos += draw2dCrosshairResult.getRight();
|
||||
|
||||
Mat outputMat;
|
||||
|
||||
if(settings.is3D) {
|
||||
if (settings.is3D) {
|
||||
// once we've sorted our targets, perform solvePNP. The number of "best targets" is limited by the above pipe
|
||||
Pair<List<TrackedTarget>, Long> solvePNPResult = solvePNPPipe.run(collect2dTargetsResult.getLeft());
|
||||
Pair<List<TrackedTarget>, Long> solvePNPResult = solvePNPPipe.run(Pair.of(collect2dTargetsResult.getLeft(), hsvResult.getLeft()));
|
||||
totalPipelineTimeNanos += solvePNPResult.getRight();
|
||||
|
||||
Pair<Mat, Long> draw3dContoursResult = drawSolvePNPPipe.run(Pair.of(outputMatResult.getLeft(), solvePNPResult.getLeft()));
|
||||
@@ -254,6 +258,7 @@ public class StandardCVPipeline extends CVPipeline<StandardCVPipelineResult, Sta
|
||||
public double pitch = 0.0;
|
||||
public double yaw = 0.0;
|
||||
public double area = 0.0;
|
||||
public Point point = new Point();
|
||||
public RotatedRect minAreaRect;
|
||||
|
||||
// 3d stuff
|
||||
@@ -263,12 +268,16 @@ public class StandardCVPipeline extends CVPipeline<StandardCVPipelineResult, Sta
|
||||
public MatOfPoint2f imageCornerPoints = new MatOfPoint2f();
|
||||
public Pair<Rect, Rect> leftRightDualTargetPair = null;
|
||||
public Pair<RotatedRect, RotatedRect> leftRightRotatedRect = null;
|
||||
public MatOfPoint2f rawContour = kMat2f;
|
||||
public MatOfPoint2f approxPoly = new MatOfPoint2f();
|
||||
|
||||
public void release() {
|
||||
rVector.release();
|
||||
tVector.release();
|
||||
imageCornerPoints.release();
|
||||
}
|
||||
|
||||
private static final MatOfPoint2f kMat2f = new MatOfPoint2f();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.chameleonvision.vision.pipeline.impl;
|
||||
|
||||
import com.chameleonvision.vision.enums.CalibrationMode;
|
||||
import com.chameleonvision.vision.enums.SortMode;
|
||||
import com.chameleonvision.vision.enums.TargetGroup;
|
||||
import com.chameleonvision.vision.enums.TargetIntersection;
|
||||
import com.chameleonvision.vision.enums.*;
|
||||
import com.chameleonvision.vision.pipeline.CVPipelineSettings;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import edu.wpi.first.wpilibj.util.Units;
|
||||
@@ -27,6 +24,8 @@ public class StandardCVPipelineSettings extends CVPipelineSettings {
|
||||
public Number speckle = 5;
|
||||
public boolean isBinary = false;
|
||||
public SortMode sortMode = SortMode.Largest;
|
||||
public TargetRegion targetRegion = TargetRegion.Center;
|
||||
public TargetOrientation targetOrientation = TargetOrientation.Landscape;
|
||||
public boolean multiple = false;
|
||||
public TargetGroup targetGroup = TargetGroup.Single;
|
||||
public TargetIntersection targetIntersection = TargetIntersection.Up;
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package com.chameleonvision.vision.pipeline.pipes;
|
||||
|
||||
import com.chameleonvision.vision.camera.CaptureStaticProperties;
|
||||
import com.chameleonvision.vision.enums.TargetOrientation;
|
||||
import com.chameleonvision.vision.enums.TargetRegion;
|
||||
import com.chameleonvision.vision.pipeline.Pipe;
|
||||
import com.chameleonvision.vision.pipeline.impl.StandardCVPipeline;
|
||||
import com.chameleonvision.vision.enums.CalibrationMode;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.commons.math3.util.FastMath;
|
||||
import org.opencv.core.Point;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
public class Collect2dTargetsPipe implements Pipe<Pair<List<StandardCVPipeline.TrackedTarget>, CaptureStaticProperties>, List<StandardCVPipeline.TrackedTarget>> {
|
||||
|
||||
@@ -17,18 +19,23 @@ public class Collect2dTargetsPipe implements Pipe<Pair<List<StandardCVPipeline.T
|
||||
private CalibrationMode calibrationMode;
|
||||
private List<Number> calibrationPoint;
|
||||
private double calibrationM, calibrationB;
|
||||
private TargetRegion targetRegion;
|
||||
private TargetOrientation targetOrientation;
|
||||
private List<StandardCVPipeline.TrackedTarget> targets = new ArrayList<>();
|
||||
private Point[] vertices = new Point[4];
|
||||
|
||||
public Collect2dTargetsPipe(CalibrationMode calibrationMode, List<Number> calibrationPoint, double calibrationM, double calibrationB, CaptureStaticProperties camProps) {
|
||||
setConfig(calibrationMode, calibrationPoint, calibrationM, calibrationB, camProps);
|
||||
public Collect2dTargetsPipe(CalibrationMode calibrationMode, TargetRegion targetRegion, TargetOrientation targetOrientation, List<Number> calibrationPoint, double calibrationM, double calibrationB, CaptureStaticProperties camProps) {
|
||||
setConfig(calibrationMode, targetRegion, targetOrientation, calibrationPoint, calibrationM, calibrationB, camProps);
|
||||
}
|
||||
|
||||
public void setConfig(CalibrationMode calibrationMode, List<Number> calibrationPoint, double calibrationM, double calibrationB, CaptureStaticProperties camProps) {
|
||||
public void setConfig(CalibrationMode calibrationMode, TargetRegion targetRegion, TargetOrientation targetOrientation, List<Number> calibrationPoint, double calibrationM, double calibrationB, CaptureStaticProperties camProps) {
|
||||
this.calibrationMode = calibrationMode;
|
||||
this.calibrationPoint = calibrationPoint;
|
||||
this.calibrationM = calibrationM;
|
||||
this.calibrationB = calibrationB;
|
||||
this.camProps = camProps;
|
||||
this.targetRegion = targetRegion;
|
||||
this.targetOrientation = targetOrientation;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -41,10 +48,42 @@ public class Collect2dTargetsPipe implements Pipe<Pair<List<StandardCVPipeline.T
|
||||
|
||||
if (input.size() > 0) {
|
||||
for (var t : input) {
|
||||
t.minAreaRect.points(vertices);
|
||||
Point bl = getMiddle(vertices[0], vertices[1]);
|
||||
Point tl = getMiddle(vertices[1], vertices[2]);
|
||||
Point tr = getMiddle(vertices[2], vertices[3]);
|
||||
Point br = getMiddle(vertices[3], vertices[0]);
|
||||
boolean orientation;
|
||||
if (targetOrientation == TargetOrientation.Landscape) {
|
||||
orientation = t.minAreaRect.size.width > t.minAreaRect.size.height;
|
||||
} else {
|
||||
orientation = t.minAreaRect.size.width < t.minAreaRect.size.height;
|
||||
}
|
||||
|
||||
Point result = t.minAreaRect.center;
|
||||
switch (this.targetRegion) {
|
||||
case Top: {
|
||||
result = orientation ? tl : tr;
|
||||
break;
|
||||
}
|
||||
case Bottom: {
|
||||
result = orientation ? br : bl;
|
||||
break;
|
||||
}
|
||||
case Left: {
|
||||
result = orientation ? bl : tl;
|
||||
break;
|
||||
}
|
||||
case Right: {
|
||||
result = orientation ? tr : br;
|
||||
break;
|
||||
}
|
||||
}
|
||||
t.point = result;
|
||||
|
||||
switch (this.calibrationMode) {
|
||||
case Single:
|
||||
if(this.calibrationPoint.isEmpty())
|
||||
{
|
||||
if (this.calibrationPoint.isEmpty()) {
|
||||
this.calibrationPoint.add(camProps.centerX);
|
||||
this.calibrationPoint.add(camProps.centerY);
|
||||
}
|
||||
@@ -56,13 +95,13 @@ public class Collect2dTargetsPipe implements Pipe<Pair<List<StandardCVPipeline.T
|
||||
t.calibratedY = camProps.centerY;
|
||||
break;
|
||||
case Dual:
|
||||
t.calibratedX = (t.minAreaRect.center.y - this.calibrationB) / this.calibrationM;
|
||||
t.calibratedY = (t.minAreaRect.center.x * this.calibrationM) + this.calibrationB;
|
||||
t.calibratedX = (t.point.x - this.calibrationB) / this.calibrationM;
|
||||
t.calibratedY = (t.point.y * this.calibrationM) + this.calibrationB;
|
||||
break;
|
||||
}
|
||||
|
||||
t.pitch = calculatePitch(t.minAreaRect.center.y, t.calibratedY);
|
||||
t.yaw = calculateYaw(t.minAreaRect.center.x, t.calibratedX);
|
||||
t.pitch = calculatePitch(t.point.y, t.calibratedY);
|
||||
t.yaw = calculateYaw(t.point.x, t.calibratedX);
|
||||
t.area = t.minAreaRect.size.area() / imageArea;
|
||||
|
||||
targets.add(t);
|
||||
@@ -81,4 +120,8 @@ public class Collect2dTargetsPipe implements Pipe<Pair<List<StandardCVPipeline.T
|
||||
private double calculateYaw(double pixelX, double centerX) {
|
||||
return FastMath.toDegrees(FastMath.atan((pixelX - centerX) / camProps.horizontalFocalLength));
|
||||
}
|
||||
|
||||
private Point getMiddle(Point p1, Point p2) {
|
||||
return new Point(((p1.x + p2.x) / 2), ((p1.y + p2.y) / 2));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,9 +64,6 @@ public class Draw2dContoursPipe implements Pipe<Pair<Mat, List<StandardCVPipelin
|
||||
// MatOfPoint contour = new MatOfPoint(vertices);
|
||||
drawnContours.add(contour);
|
||||
|
||||
if (settings.showCentroid) {
|
||||
Imgproc.circle(input.getLeft(), r.center, 3, Helpers.colorToScalar(settings.centroidColor));
|
||||
}
|
||||
|
||||
if (settings.showRotatedBox) {
|
||||
Imgproc.drawContours(input.getLeft(), drawnContours, 0, Helpers.colorToScalar(settings.rotatedBoxColor), settings.boxOutlineSize);
|
||||
@@ -76,6 +73,10 @@ public class Draw2dContoursPipe implements Pipe<Pair<Mat, List<StandardCVPipelin
|
||||
Rect box = Imgproc.boundingRect(contour);
|
||||
Imgproc.rectangle(input.getLeft(), new Point(box.x, box.y), new Point((box.x + box.width), (box.y + box.height)), Helpers.colorToScalar(settings.maximumBoxColor), settings.boxOutlineSize);
|
||||
}
|
||||
if (settings.showCentroid) {
|
||||
Imgproc.circle(input.getLeft(), target.point, 3, Helpers.colorToScalar(settings.centroidColor), 2);
|
||||
|
||||
}
|
||||
|
||||
// contour.release();
|
||||
}
|
||||
|
||||
@@ -17,11 +17,14 @@ public class DrawSolvePNPPipe implements Pipe<Pair<Mat, List<StandardCVPipeline.
|
||||
|
||||
private MatOfPoint3f boxCornerMat = new MatOfPoint3f();
|
||||
|
||||
public Scalar color = Helpers.colorToScalar(Color.GREEN);
|
||||
public Scalar green = Helpers.colorToScalar(Color.GREEN);
|
||||
public Scalar blue = Helpers.colorToScalar(Color.BLUE);
|
||||
public Scalar red = Helpers.colorToScalar(Color.RED);
|
||||
|
||||
public DrawSolvePNPPipe(CameraCalibrationConfig settings) {
|
||||
setConfig(settings);
|
||||
setObjectBox(14.5, 6, 2);
|
||||
// setObjectBox(14.5, 6, 2);
|
||||
set2020Box();
|
||||
}
|
||||
|
||||
public void setObjectBox(double targetWidth, double targetHeight, double targetDepth) {
|
||||
@@ -40,6 +43,20 @@ public class DrawSolvePNPPipe implements Pipe<Pair<Mat, List<StandardCVPipeline.
|
||||
);
|
||||
}
|
||||
|
||||
public void set2020Box() {
|
||||
boxCornerMat.release();
|
||||
boxCornerMat = new MatOfPoint3f(
|
||||
new Point3(-16.25, 0, 0),
|
||||
new Point3(-9.819867, -17, 0),
|
||||
new Point3(9.819867, -17, 0),
|
||||
new Point3(16.25, 0, 0),
|
||||
new Point3(-16.25, 0, -6),
|
||||
new Point3(-9.819867, -17, -6),
|
||||
new Point3(9.819867, -17, -6),
|
||||
new Point3(16.25, 0, -6)
|
||||
);
|
||||
}
|
||||
|
||||
private Mat cameraMatrix = new Mat();
|
||||
private MatOfDouble distortionCoefficients = new MatOfDouble();
|
||||
|
||||
@@ -56,13 +73,15 @@ public class DrawSolvePNPPipe implements Pipe<Pair<Mat, List<StandardCVPipeline.
|
||||
this.distortionCoefficients = distortionMatrix_;
|
||||
}
|
||||
|
||||
MatOfPoint2f imagePoints = new MatOfPoint2f();
|
||||
|
||||
@Override
|
||||
public Pair<Mat, Long> run(Pair<Mat, List<StandardCVPipeline.TrackedTarget>> targets) {
|
||||
long processStartNanos = System.nanoTime();
|
||||
|
||||
var image = targets.getLeft();
|
||||
for(var it : targets.getRight()) {
|
||||
MatOfPoint2f imagePoints = new MatOfPoint2f();
|
||||
|
||||
try {
|
||||
Calib3d.projectPoints(boxCornerMat, it.rVector, it.tVector, this.cameraMatrix, this.distortionCoefficients, imagePoints, new Mat() , 0);
|
||||
} catch (Exception e) {
|
||||
@@ -81,26 +100,33 @@ public class DrawSolvePNPPipe implements Pipe<Pair<Mat, List<StandardCVPipeline.
|
||||
// draw corners
|
||||
for(int i = 0; i < it.imageCornerPoints.rows(); i++) {
|
||||
var point = new Point(it.imageCornerPoints.get(i, 0));
|
||||
Imgproc.circle(image, point, 4, new Scalar(0, 255, 0), 5);
|
||||
Imgproc.circle(image, point, 4, green, 5);
|
||||
}
|
||||
|
||||
// draw poly dp
|
||||
var list = it.approxPoly.toList();
|
||||
for(int i = 0; i < list.size(); i++) {
|
||||
var next = (i == list.size() - 1) ? list.get(0) : list.get(i + 1);
|
||||
Imgproc.line(image, list.get(i), next, red, 3);
|
||||
}
|
||||
|
||||
// sketch out floor
|
||||
Imgproc.line(image, pts.get(0), pts.get(1), new Scalar(0, 255, 0), 3);
|
||||
Imgproc.line(image, pts.get(1), pts.get(2), new Scalar(0, 255, 0), 3);
|
||||
Imgproc.line(image, pts.get(2), pts.get(3), new Scalar(0, 255, 0), 3);
|
||||
Imgproc.line(image, pts.get(3), pts.get(0), new Scalar(0, 255, 0), 3);
|
||||
Imgproc.line(image, pts.get(0), pts.get(1), green, 3);
|
||||
Imgproc.line(image, pts.get(1), pts.get(2), green, 3);
|
||||
Imgproc.line(image, pts.get(2), pts.get(3), green, 3);
|
||||
Imgproc.line(image, pts.get(3), pts.get(0), green, 3);
|
||||
|
||||
// draw pillars
|
||||
Imgproc.line(image, pts.get(0), pts.get(4), new Scalar(255, 0, 0), 3);
|
||||
Imgproc.line(image, pts.get(1), pts.get(5), new Scalar(255, 0, 0), 3);
|
||||
Imgproc.line(image, pts.get(2), pts.get(6), new Scalar(255, 0, 0), 3);
|
||||
Imgproc.line(image, pts.get(3), pts.get(7), new Scalar(255, 0, 0), 3);
|
||||
Imgproc.line(image, pts.get(0), pts.get(4), blue, 3);
|
||||
Imgproc.line(image, pts.get(1), pts.get(5), blue, 3);
|
||||
Imgproc.line(image, pts.get(2), pts.get(6), blue, 3);
|
||||
Imgproc.line(image, pts.get(3), pts.get(7), blue, 3);
|
||||
|
||||
// draw top
|
||||
Imgproc.line(image, pts.get(4), pts.get(5), new Scalar(0, 0, 255), 3);
|
||||
Imgproc.line(image, pts.get(5), pts.get(6), new Scalar(0, 0, 255), 3);
|
||||
Imgproc.line(image, pts.get(6), pts.get(7), new Scalar(0, 0, 255), 3);
|
||||
Imgproc.line(image, pts.get(7), pts.get(4), new Scalar(0, 0, 255), 3);
|
||||
Imgproc.line(image, pts.get(4), pts.get(5), red, 3);
|
||||
Imgproc.line(image, pts.get(5), pts.get(6), red, 3);
|
||||
Imgproc.line(image, pts.get(6), pts.get(7), red, 3);
|
||||
Imgproc.line(image, pts.get(7), pts.get(4), red, 3);
|
||||
}
|
||||
|
||||
long processTime = System.nanoTime() - processStartNanos;
|
||||
|
||||
@@ -23,6 +23,8 @@ public class GroupContoursPipe implements Pipe<List<MatOfPoint>, List<StandardCV
|
||||
private TargetGroup group;
|
||||
private TargetIntersection intersection;
|
||||
|
||||
private MatOfPoint2f contourBuffer = new MatOfPoint2f();
|
||||
|
||||
private List<StandardCVPipeline.TrackedTarget> groupedContours = new ArrayList<>();
|
||||
private MatOfPoint2f intersectMatA = new MatOfPoint2f();
|
||||
private MatOfPoint2f intersectMatB = new MatOfPoint2f();
|
||||
@@ -43,6 +45,7 @@ public class GroupContoursPipe implements Pipe<List<MatOfPoint>, List<StandardCV
|
||||
|
||||
groupedContours.forEach(StandardCVPipeline.TrackedTarget::release);
|
||||
groupedContours.clear();
|
||||
contourBuffer.release();
|
||||
|
||||
if (input.size() > (group.equals(TargetGroup.Single) ? 0 : 1)) {
|
||||
|
||||
@@ -54,12 +57,12 @@ public class GroupContoursPipe implements Pipe<List<MatOfPoint>, List<StandardCV
|
||||
switch (group) {
|
||||
case Single: {
|
||||
input.forEach(c -> {
|
||||
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;
|
||||
target.rawContour = contourBuffer;
|
||||
groupedContours.add(target);
|
||||
}
|
||||
});
|
||||
@@ -83,26 +86,28 @@ public class GroupContoursPipe implements Pipe<List<MatOfPoint>, List<StandardCV
|
||||
intersectMatA.release();
|
||||
intersectMatB.release();
|
||||
|
||||
MatOfPoint2f contour = new MatOfPoint2f();
|
||||
contour.fromList(finalContourList);
|
||||
contourBuffer.fromList(finalContourList);
|
||||
|
||||
if (contour.cols() != 0 && contour.rows() != 0) {
|
||||
RotatedRect rect = Imgproc.minAreaRect(contour);
|
||||
if (contourBuffer.cols() != 0 && contourBuffer.rows() != 0) {
|
||||
RotatedRect rect = Imgproc.minAreaRect(contourBuffer);
|
||||
var target = new StandardCVPipeline.TrackedTarget();
|
||||
target.minAreaRect = rect;
|
||||
|
||||
// find left and right bouding rectangles
|
||||
target.leftRightDualTargetPair =
|
||||
Pair.of(Imgproc.boundingRect(firstContour),
|
||||
Imgproc.boundingRect(secondContour));
|
||||
|
||||
// find left and right min area rectangles
|
||||
tempRectMat.fromArray(firstContour.toArray());
|
||||
var minAreaRect1 = Imgproc.minAreaRect(tempRectMat);
|
||||
tempRectMat.fromArray(secondContour.toArray());
|
||||
var minAreaRect2 = Imgproc.minAreaRect(tempRectMat);
|
||||
|
||||
target.leftRightRotatedRect =
|
||||
Pair.of(minAreaRect1, minAreaRect2);
|
||||
|
||||
|
||||
target.rawContour = contourBuffer;
|
||||
|
||||
groupedContours.add(target);
|
||||
|
||||
firstContour.release();
|
||||
|
||||
@@ -13,14 +13,10 @@ import org.opencv.calib3d.Calib3d;
|
||||
import org.opencv.core.*;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class SolvePNPPipe implements Pipe<List<StandardCVPipeline.TrackedTarget>, List<StandardCVPipeline.TrackedTarget>> {
|
||||
public class SolvePNPPipe implements Pipe<Pair<List<StandardCVPipeline.TrackedTarget>, Mat>, List<StandardCVPipeline.TrackedTarget>> {
|
||||
|
||||
private Double tilt_angle;
|
||||
private MatOfPoint3f objPointsMat = new MatOfPoint3f();
|
||||
@@ -41,11 +37,28 @@ public class SolvePNPPipe implements Pipe<List<StandardCVPipeline.TrackedTarget>
|
||||
public SolvePNPPipe(StandardCVPipelineSettings settings, CameraCalibrationConfig calibration, Rotation2d tilt) {
|
||||
super();
|
||||
setCameraCoeffs(calibration);
|
||||
setTarget(settings.targetWidth, settings.targetHeight);
|
||||
// setBoundingBoxTarget(settings.targetWidth, settings.targetHeight);
|
||||
// TODO add proper year differentiation
|
||||
set2020Target(true);
|
||||
|
||||
this.tilt_angle = tilt.getRadians();
|
||||
}
|
||||
|
||||
public void setTarget(double targetWidth, double targetHeight) {
|
||||
public void set2020Target(boolean isHighGoal) {
|
||||
if(isHighGoal) {
|
||||
// tl, bl, br, tr is the order
|
||||
List<Point3> corners = List.of(
|
||||
new Point3(-16.25, 0, 0),
|
||||
new Point3(-9.819867, -17, 0),
|
||||
new Point3(9.819867, -17, 0),
|
||||
new Point3(16.25, 0, 0));
|
||||
setObjectCorners(corners);
|
||||
} else {
|
||||
setBoundingBoxTarget(7, 11);
|
||||
}
|
||||
}
|
||||
|
||||
public void setBoundingBoxTarget(double targetWidth, double targetHeight) {
|
||||
// order is left top, left bottom, right bottom, right top
|
||||
|
||||
List<Point3> corners = List.of(
|
||||
@@ -65,7 +78,8 @@ public class SolvePNPPipe implements Pipe<List<StandardCVPipeline.TrackedTarget>
|
||||
|
||||
public void setConfig(StandardCVPipelineSettings settings, CameraCalibrationConfig camConfig, Rotation2d tilt) {
|
||||
setCameraCoeffs(camConfig);
|
||||
setTarget(settings.targetWidth, settings.targetHeight);
|
||||
// setBoundingBoxTarget(settings.targetWidth, settings.targetHeight);
|
||||
// TODO add proper year differentiation
|
||||
tilt_angle = tilt.getRadians();
|
||||
}
|
||||
|
||||
@@ -86,11 +100,13 @@ public class SolvePNPPipe implements Pipe<List<StandardCVPipeline.TrackedTarget>
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pair<List<StandardCVPipeline.TrackedTarget>, Long> run(List<StandardCVPipeline.TrackedTarget> targets) {
|
||||
public Pair<List<StandardCVPipeline.TrackedTarget>, Long> run(Pair<List<StandardCVPipeline.TrackedTarget>, Mat> imageTargetPair) {
|
||||
long processStartNanos = System.nanoTime();
|
||||
var targets = imageTargetPair.getLeft();
|
||||
poseList.clear();
|
||||
for(var target: targets) {
|
||||
var corners = (target.leftRightDualTargetPair != null) ? findCorner2019(target) : findBoundingBoxCorners(target);
|
||||
var corners = find2020VisionTarget(target);//, imageTargetPair.getRight()); //find2020VisionTarget(target);// (target.leftRightDualTargetPair != null) ? findCorner2019(target) : findBoundingBoxCorners(target);
|
||||
if(corners == null) continue;
|
||||
var pose = calculatePose(corners, target);
|
||||
if(pose != null) poseList.add(pose);
|
||||
}
|
||||
@@ -121,10 +137,54 @@ public class SolvePNPPipe implements Pipe<List<StandardCVPipeline.TrackedTarget>
|
||||
return points;
|
||||
}
|
||||
|
||||
private MatOfPoint2f findCornerMinAreaRect(StandardCVPipeline.TrackedTarget target) {
|
||||
/**
|
||||
* Find the target using the outermost tape corners and a 2020 target.
|
||||
* @param target the target.
|
||||
* @return The four outermost tape corners.
|
||||
*/
|
||||
private MatOfPoint2f find2020VisionTarget(StandardCVPipeline.TrackedTarget target) {
|
||||
if(target.rawContour.cols() < 1) return null;
|
||||
|
||||
var centroid = target.minAreaRect.center;
|
||||
Comparator<Point> distanceProvider = Comparator.comparingDouble((Point point) -> FastMath.sqrt(FastMath.pow(centroid.x - point.x, 2) + FastMath.pow(centroid.y - point.y, 2)));
|
||||
|
||||
var contour = target.rawContour;
|
||||
var combinedList = contour.toList();
|
||||
|
||||
// approx poly dp time
|
||||
Imgproc.approxPolyDP(contour, polyOutput, 3, true);
|
||||
var polyList = polyOutput.toList();
|
||||
|
||||
polyOutput.copyTo(target.approxPoly);
|
||||
|
||||
// start looking in the top left quadrant
|
||||
try {
|
||||
var tl = polyList.stream().filter(point -> point.x < centroid.x && point.y < centroid.y).max(distanceProvider).get();
|
||||
var tr = polyList.stream().filter(point -> point.x > centroid.x && point.y < centroid.y).max(distanceProvider).get();
|
||||
var bl = polyList.stream().filter(point -> point.x < centroid.x && point.y > centroid.y).max(distanceProvider).get();
|
||||
var br = polyList.stream().filter(point -> point.x > centroid.x && point.y > centroid.y).max(distanceProvider).get();
|
||||
|
||||
boundingBoxResultMat.release();
|
||||
boundingBoxResultMat.fromList(List.of(tl, bl, br, tr));
|
||||
|
||||
return boundingBoxResultMat;
|
||||
} catch (NoSuchElementException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
MatOfPoint2f polyOutput = new MatOfPoint2f();
|
||||
|
||||
/**
|
||||
* Find the target using the outermost tape corners and a dual target.
|
||||
* @param target the target.
|
||||
* @return The four outermost tape corners.
|
||||
*/
|
||||
private MatOfPoint2f findDualTargetCornerMinAreaRect(StandardCVPipeline.TrackedTarget target) {
|
||||
if(target.leftRightRotatedRect == null) return null;
|
||||
|
||||
var centroid = target.minAreaRect.center;
|
||||
Comparator<Point> distanceProvider = Comparator.comparingDouble((Point point) -> FastMath.sqrt(FastMath.pow(centroid.x - point.x, 2) + FastMath.pow(centroid.y - point.y, 2)));
|
||||
|
||||
var left = target.leftRightRotatedRect.getLeft();
|
||||
var right = target.leftRightRotatedRect.getRight();
|
||||
@@ -144,8 +204,6 @@ public class SolvePNPPipe implements Pipe<List<StandardCVPipeline.TrackedTarget>
|
||||
combinedList.addAll(List.of(rightPoints));
|
||||
|
||||
// start looking in the top left quadrant
|
||||
Comparator<Point> distanceProvider = Comparator.comparingDouble((Point point) -> FastMath.sqrt(FastMath.pow(centroid.x - point.x, 2) + FastMath.pow(centroid.y - point.y, 2)));
|
||||
|
||||
var tl = combinedList.stream().filter(point -> point.x < centroid.x && point.y < centroid.y).max(distanceProvider).get();
|
||||
var tr = combinedList.stream().filter(point -> point.x > centroid.x && point.y < centroid.y).max(distanceProvider).get();
|
||||
var bl = combinedList.stream().filter(point -> point.x < centroid.x && point.y > centroid.y).max(distanceProvider).get();
|
||||
@@ -244,13 +302,19 @@ public class SolvePNPPipe implements Pipe<List<StandardCVPipeline.TrackedTarget>
|
||||
|
||||
// Imgproc.approxPolyDP(new MatOfPoint2f(max_contour.toArray()),approx,epsilon,true);
|
||||
|
||||
// start by looking at the targets
|
||||
var leftRight = target.leftRightDualTargetPair;
|
||||
var reverse = (leftRight.getLeft().x < leftRight.getRight().x);
|
||||
var left = reverse ? leftRight.getLeft() : leftRight.getRight();
|
||||
var right = !reverse ? leftRight.getLeft() : leftRight.getRight();
|
||||
var boundingTl = left.tl();
|
||||
var boundingBr = right.br();
|
||||
// start by looking for corners
|
||||
var points__ = findBoundingBoxCorners(target).toList();
|
||||
var xList = points__.stream().map(it -> it.x).sorted(Double::compare).collect(Collectors.toList());
|
||||
var yList = points__.stream().map(it -> it.y).sorted(Double::compare).collect(Collectors.toList());
|
||||
|
||||
var boundingTl = new Point(
|
||||
xList.get(0), yList.get(0)
|
||||
);
|
||||
var boundingBr = new Point (
|
||||
xList.get(2), yList.get(2)
|
||||
);
|
||||
|
||||
System.out.println("tl/br:\n" + boundingTl.toString() + "\n" + boundingBr.toString());
|
||||
|
||||
var slightlyBiggerTl = new Point(
|
||||
Math.max(0, boundingTl.x - 5),
|
||||
@@ -265,10 +329,10 @@ public class SolvePNPPipe implements Pipe<List<StandardCVPipeline.TrackedTarget>
|
||||
|
||||
var croppedImage = srcImage.submat(rect);
|
||||
var corners = new MatOfPoint();
|
||||
Imgproc.goodFeaturesToTrack(croppedImage, corners, 8,0.5,5);
|
||||
Imgproc.goodFeaturesToTrack(croppedImage, corners, 0,0.01,5);
|
||||
|
||||
List<Point> cornerList = new ArrayList<>(corners.toList());
|
||||
if(cornerList.size() != 8 && cornerList.size() != 4) return null;
|
||||
// if(cornerList.size() != 8 && cornerList.size() != 4) return null;
|
||||
cornerList.sort(leftRightComparator);
|
||||
|
||||
cornerList = cornerList.stream().map(point ->
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
.theme--light.v-radio--is-disabled label{color:rgba(0,0,0,.38)}.theme--light.v-radio--is-disabled .v-icon{color:rgba(0,0,0,.26)!important}.theme--dark.v-radio--is-disabled label{color:hsla(0,0%,100%,.5)}.theme--dark.v-radio--is-disabled .v-icon{color:hsla(0,0%,100%,.3)!important}.v-radio{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;height:auto;margin-right:16px;outline:none}.v-radio--is-disabled{pointer-events:none}.v-input--radio-group__input{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}.v-input--radio-group--column .v-input--radio-group__input>.v-label{padding-bottom:8px}.v-input--radio-group--row .v-input--radio-group__input>.v-label{padding-right:8px}.v-input--radio-group--row .v-input--radio-group__input{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}.v-input--radio-group--column .v-radio:not(:last-child):not(:only-child){margin-bottom:8px}.v-input--radio-group--column .v-input--radio-group__input{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.videoClass[data-v-334f1a60]{text-align:center}.videoClass img[data-v-334f1a60]{padding-top:10px;height:auto!important;width:75%;vertical-align:middle}.colsClass[data-v-334f1a60]{padding:0!important}
|
||||
@@ -0,0 +1 @@
|
||||
.hover[data-v-912b6e62]:hover{color:#fff!important}.v-tooltip{display:inline}.v-tooltip__content{background:rgba(97,97,97,.9);color:#fff;border-radius:4px;font-size:14px;line-height:22px;display:inline-block;padding:5px 16px;position:absolute;text-transform:none;width:auto;opacity:1;pointer-events:none}.v-tooltip__content--fixed{position:fixed}.v-tooltip__content[class*=-active]{-webkit-transition-timing-function:cubic-bezier(0,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1)}.v-tooltip__content[class*=enter-active]{-webkit-transition-duration:.15s;transition-duration:.15s}.v-tooltip__content[class*=leave-active]{-webkit-transition-duration:75ms;transition-duration:75ms}.colsClass[data-v-3b74cf0c]{padding:0!important}.videoClass[data-v-3b74cf0c]{text-align:center}.tableClass[data-v-3b74cf0c]{padding-top:5px;width:70%;text-align:center}th[data-v-3b74cf0c]{width:80px;text-align:center}.v-input--checkbox.v-input--indeterminate.v-input--is-disabled{opacity:.6}.v-dialog{border-radius:4px;margin:24px;overflow-y:auto;pointer-events:auto;-webkit-transition:.3s cubic-bezier(.25,.8,.25,1);transition:.3s cubic-bezier(.25,.8,.25,1);width:100%;z-index:inherit;-webkit-box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12);box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12)}.v-dialog:not(.v-dialog--fullscreen){max-height:90%}.v-dialog>*{width:100%}.v-dialog>.v-card>.v-card__title{font-size:1.25rem;font-weight:500;letter-spacing:.0125em;padding:16px 24px 10px}.v-dialog>.v-card>.v-card__text{padding:0 24px 20px}.v-dialog__content{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;height:100%;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;left:0;pointer-events:none;position:fixed;top:0;-webkit-transition:.2s cubic-bezier(.25,.8,.25,1),z-index 1ms;transition:.2s cubic-bezier(.25,.8,.25,1),z-index 1ms;width:100%;z-index:6;outline:none}.v-dialog__activator,.v-dialog__activator *{cursor:pointer}.v-dialog__container{display:inline}.v-dialog--animated{-webkit-animation-duration:.15s;animation-duration:.15s;-webkit-animation-name:animate-dialog;animation-name:animate-dialog;-webkit-animation-timing-function:cubic-bezier(.25,.8,.25,1);animation-timing-function:cubic-bezier(.25,.8,.25,1)}.v-dialog--fullscreen{border-radius:0;margin:0;height:100%;position:fixed;overflow-y:auto;top:0;left:0}.v-dialog--fullscreen>.v-card{min-height:100%;min-width:100%;margin:0!important;padding:0!important}.v-dialog--scrollable,.v-dialog--scrollable>form{display:-webkit-box;display:-ms-flexbox;display:flex}.v-dialog--scrollable>.v-card,.v-dialog--scrollable>form>.v-card{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1 1 100%;flex:1 1 100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;max-height:100%;max-width:100%}.v-dialog--scrollable>.v-card>.v-card__actions,.v-dialog--scrollable>.v-card>.v-card__title,.v-dialog--scrollable>form>.v-card>.v-card__actions,.v-dialog--scrollable>form>.v-card>.v-card__title{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.v-dialog--scrollable>.v-card>.v-card__text,.v-dialog--scrollable>form>.v-card>.v-card__text{-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;overflow-y:auto}@-webkit-keyframes animate-dialog{0%{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.03);transform:scale(1.03)}to{-webkit-transform:scale(1);transform:scale(1)}}@keyframes animate-dialog{0%{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.03);transform:scale(1.03)}to{-webkit-transform:scale(1);transform:scale(1)}}.theme--light.v-overlay{color:rgba(0,0,0,.87)}.theme--dark.v-overlay{color:#fff}.v-overlay{-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-radius:inherit;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:fixed;top:0;left:0;right:0;bottom:0;pointer-events:none;-webkit-transition:.3s cubic-bezier(.25,.8,.5,1),z-index 1ms;transition:.3s cubic-bezier(.25,.8,.5,1),z-index 1ms}.v-overlay__content{position:relative}.v-overlay__scrim{border-radius:inherit;bottom:0;height:100%;left:0;position:absolute;right:0;top:0;-webkit-transition:inherit;transition:inherit;width:100%;will-change:opacity}.v-overlay--absolute{position:absolute}.v-overlay--active{pointer-events:auto;-ms-touch-action:none;touch-action:none}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
.theme--light.v-input--range-slider.v-input--slider.v-input--is-disabled .v-slider.v-slider .v-slider__thumb{background:#fafafa}.theme--dark.v-input--range-slider.v-input--slider.v-input--is-disabled .v-slider.v-slider .v-slider__thumb{background:#424242}.v-input--range-slider.v-input--is-disabled .v-slider__track-fill{display:none}.v-input--range-slider.v-input--is-disabled.v-input--slider .v-slider.v-slider .v-slider__thumb{border-color:transparent}
|
||||
@@ -1 +0,0 @@
|
||||
.theme--light.v-radio--is-disabled label{color:rgba(0,0,0,.38)}.theme--light.v-radio--is-disabled .v-icon{color:rgba(0,0,0,.26)!important}.theme--dark.v-radio--is-disabled label{color:hsla(0,0%,100%,.5)}.theme--dark.v-radio--is-disabled .v-icon{color:hsla(0,0%,100%,.3)!important}.v-radio{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;height:auto;margin-right:16px;outline:none}.v-radio--is-disabled{pointer-events:none}.v-input--radio-group__input{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}.v-input--radio-group--column .v-input--radio-group__input>.v-label{padding-bottom:8px}.v-input--radio-group--row .v-input--radio-group__input>.v-label{padding-right:8px}.v-input--radio-group--row .v-input--radio-group__input{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}.v-input--radio-group--column .v-radio:not(:last-child):not(:only-child){margin-bottom:8px}.v-input--radio-group--column .v-input--radio-group__input{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.videoClass[data-v-0b265c21]{text-align:center}.videoClass img[data-v-0b265c21]{padding-top:10px;height:auto!important;width:75%;vertical-align:middle}.colsClass[data-v-0b265c21]{padding:0!important}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
@@ -1 +1 @@
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.png><title>Chameleon Vision</title><link rel=stylesheet href=/Roboto.css><link href=/css/chunk-234aed0c.5856ebfe.css rel=prefetch><link href=/css/chunk-37b1319c.6907c2af.css rel=prefetch><link href=/css/chunk-402ab08c.d47fe89d.css rel=prefetch><link href=/css/chunk-5d00d1c8.199ed0d3.css rel=prefetch><link href=/css/chunk-69fdce18.52ef46aa.css rel=prefetch><link href=/css/chunk-716fb61c.78b3d049.css rel=prefetch><link href=/css/chunk-7a810817.e757f52a.css rel=prefetch><link href=/css/chunk-7cf477eb.2ea217a5.css rel=prefetch><link href=/css/chunk-8bc075b4.52ef46aa.css rel=prefetch><link href=/css/chunk-b88ff188.2fb6e44b.css rel=prefetch><link href=/js/chunk-234aed0c.3d3728c3.js rel=prefetch><link href=/js/chunk-37b1319c.2e497e79.js rel=prefetch><link href=/js/chunk-3ae1c3ad.60faee15.js rel=prefetch><link href=/js/chunk-402ab08c.c628d134.js rel=prefetch><link href=/js/chunk-5d00d1c8.ad81a993.js rel=prefetch><link href=/js/chunk-69fdce18.4d1cf405.js rel=prefetch><link href=/js/chunk-716fb61c.84a36d26.js rel=prefetch><link href=/js/chunk-7a810817.baa2981a.js rel=prefetch><link href=/js/chunk-7cf477eb.574926c0.js rel=prefetch><link href=/js/chunk-8bc075b4.6ee7e19a.js rel=prefetch><link href=/js/chunk-98e0c8cc.a1d7ab48.js rel=prefetch><link href=/js/chunk-b88ff188.4fc8cbd4.js rel=prefetch><link href=/css/app.9a11344b.css rel=preload as=style><link href=/css/chunk-vendors.cc4c495b.css rel=preload as=style><link href=/js/app.9a8d90bd.js rel=preload as=script><link href=/js/chunk-vendors.90d5c4b3.js rel=preload as=script><link href=/css/chunk-vendors.cc4c495b.css rel=stylesheet><link href=/css/app.9a11344b.css rel=stylesheet></head><body><noscript><strong>We're sorry but Chameleon Vision doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.90d5c4b3.js></script><script src=/js/app.9a8d90bd.js></script></body></html>
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.png><title>Chameleon Vision</title><link rel=stylesheet href=/Roboto.css><link href=/css/chunk-218b16fc.84e78a37.css rel=prefetch><link href=/css/chunk-234aed0c.5856ebfe.css rel=prefetch><link href=/css/chunk-30cf0ee8.437bbfd3.css rel=prefetch><link href=/css/chunk-33f18466.5da4dc56.css rel=prefetch><link href=/css/chunk-402ab08c.d47fe89d.css rel=prefetch><link href=/css/chunk-74cde756.7753bf1c.css rel=prefetch><link href=/css/chunk-79a507e8.4c388212.css rel=prefetch><link href=/css/chunk-7a810817.e757f52a.css rel=prefetch><link href=/css/chunk-7cf477eb.2ea217a5.css rel=prefetch><link href=/css/chunk-8bc075b4.52ef46aa.css rel=prefetch><link href=/js/chunk-1c4e016e.3c63bd07.js rel=prefetch><link href=/js/chunk-218b16fc.85ae3dfa.js rel=prefetch><link href=/js/chunk-234aed0c.5ce036d9.js rel=prefetch><link href=/js/chunk-30cf0ee8.a08facb0.js rel=prefetch><link href=/js/chunk-33f18466.b80a16b3.js rel=prefetch><link href=/js/chunk-3ae1c3ad.5aface64.js rel=prefetch><link href=/js/chunk-402ab08c.6a0cfa00.js rel=prefetch><link href=/js/chunk-74cde756.538b7b46.js rel=prefetch><link href=/js/chunk-79a507e8.a8f72f00.js rel=prefetch><link href=/js/chunk-7a810817.6fa5d1de.js rel=prefetch><link href=/js/chunk-7cf477eb.ccf582bf.js rel=prefetch><link href=/js/chunk-8bc075b4.c1dd0af7.js rel=prefetch><link href=/css/app.9a11344b.css rel=preload as=style><link href=/css/chunk-vendors.cc4c495b.css rel=preload as=style><link href=/js/app.b9fa435a.js rel=preload as=script><link href=/js/chunk-vendors.90d5c4b3.js rel=preload as=script><link href=/css/chunk-vendors.cc4c495b.css rel=stylesheet><link href=/css/app.9a11344b.css rel=stylesheet></head><body><noscript><strong>We're sorry but Chameleon Vision doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=/js/chunk-vendors.90d5c4b3.js></script><script src=/js/app.b9fa435a.js></script></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +0,0 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0cbefe"],{"4c92":function(t,a,e){"use strict";e.r(a);var o=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",[e("CVselect",{attrs:{name:"SortMode",list:["Largest","Smallest","Highest","Lowest","Rightmost","Leftmost","Centermost"]},on:{input:function(a){return t.handleData("sortMode")}},model:{value:t.value.sortMode,callback:function(a){t.$set(t.value,"sortMode",a)},expression:"value.sortMode"}}),e("span",[t._v("Calibrate:")]),e("v-divider",{attrs:{dark:"",color:"white"}}),e("CVselect",{attrs:{name:"Calibration Mode",list:["None","Single point","Dual point"]},on:{input:function(a){return t.handleData("calibrationMode")}},model:{value:t.value.calibrationMode,callback:function(a){t.$set(t.value,"calibrationMode",a)},expression:"value.calibrationMode"}}),e(t.selectedComponent,{tag:"component",attrs:{"raw-point":t.rawPoint},on:{update:t.doUpdate}}),e("v-snackbar",{attrs:{timeout:3e3,top:"",color:"error"},model:{value:t.snackbar,callback:function(a){t.snackbar=a},expression:"snackbar"}},[e("span",{staticStyle:{color:"#000"}},[t._v("Points are too close")]),e("v-btn",{attrs:{color:"black",text:""},on:{click:function(a){t.snackbar=!1}}},[t._v("Close")])],1)],1)},n=[],i=e("8384"),l=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",[e("v-row",{attrs:{align:"center",justify:"start"}},[e("v-col",{staticStyle:{"padding-right":"0"},attrs:{cols:3}},[e("v-btn",{attrs:{small:"",color:"#4baf62"},on:{click:t.takePointA}},[t._v("Take Point A")])],1),e("v-col",{staticStyle:{"margin-left":"0"},attrs:{cols:3}},[e("v-btn",{attrs:{small:"",color:"#4baf62"},on:{click:t.takePointB}},[t._v("Take Point B")])],1),e("v-col",[e("v-btn",{attrs:{small:"",color:"yellow darken-3"},on:{click:t.clearSlope}},[t._v("Clear All Points")])],1)],1)],1)},s=[],r={name:"DualCalibration",props:["rawPoint"],data(){return{pointA:void 0,pointB:void 0}},methods:{takePointA(){this.pointA=this.rawPoint,this.calcSlope()},takePointB(){this.pointB=this.rawPoint,this.calcSlope()},calcSlope(){if(void 0!==this.pointA&&void 0!==this.pointB){let t=(this.pointB[1]-this.pointA[1])/(this.pointB[0]-this.pointA[0]),a=this.pointA[1]-t*this.pointA[0];!1===isNaN(t)&&!1===isNaN(a)?this.sendSlope(t,a,!0):this.$emit("snackbar"),this.pointA=void 0,this.pointB=void 0}},sendSlope(t,a,e){this.handleInput("m",t),this.handleInput("b",a),this.$emit("update")},clearSlope(){this.sendSlope(1,0,!1),this.pointA=void 0,this.pointB=void 0}}},c=r,p=e("2877"),d=e("6544"),u=e.n(d),h=e("8336"),v=e("62ad"),b=e("0fd9"),m=Object(p["a"])(c,l,s,!1,null,"c7f473fa",null),k=m.exports;u()(m,{VBtn:h["a"],VCol:v["a"],VRow:b["a"]});var f=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",[e("v-row",{attrs:{align:"center",justify:"start"}},[e("v-col",{staticStyle:{"padding-right":"0"},attrs:{cols:3}},[e("v-btn",{attrs:{small:"",color:"#4baf62"},on:{click:t.takePoint}},[t._v("Take Point")])],1),e("v-col",[e("v-btn",{attrs:{small:"",color:"yellow darken-3"},on:{click:t.clearPoint}},[t._v("Clear Point")])],1)],1)],1)},w=[],P={name:"SingleCalibration",props:["rawPoint"],methods:{clearPoint(){this.handleInput("point",[0,0]),this.$emit("update")},takePoint(){this.handleInput("point",this.rawPoint),this.$emit("update")}}},C=P,S=Object(p["a"])(C,f,w,!1,null,"aed760c8",null),g=S.exports;u()(S,{VBtn:h["a"],VCol:v["a"],VRow:b["a"]});var _={name:"Output",props:["value"],components:{CVselect:i["a"],SingleCalibration:g,DualCalibration:k},methods:{handleData(t){this.handleInput(t,this.value[t]),this.$emit("update")},doUpdate(){this.$emit("update")}},data(){return{snackbar:!1}},computed:{selectedComponent:{get(){switch(this.value.calibrationMode){case 0:return"";case 1:return"SingleCalibration";case 2:return"DualCalibration"}return""}},rawPoint:{get(){return this.$store.state.point.rawPoint}}}},A=_,B=e("ce7e"),V=e("2db4"),$=Object(p["a"])(A,o,n,!1,null,"fb42e886",null);a["default"]=$.exports;u()($,{VBtn:h["a"],VDivider:B["a"],VSnackbar:V["a"]})}}]);
|
||||
//# sourceMappingURL=chunk-2d0cbefe.8112a72c.js.map
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3ae1c3ad"],{1447:function(e,t,a){"use strict";var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("v-row",{attrs:{dense:"",align:"center"}},[a("v-col",{attrs:{cols:2}},[a("span",[e._v(e._s(e.name))])]),a("v-col",{attrs:{cols:10}},[a("v-slider",{staticClass:"align-center",attrs:{value:e.localValue,dark:"",max:e.max,min:e.min,"hide-details":"",color:"#4baf62",step:e.step},on:{start:function(t){e.isClicked=!0},end:function(t){e.isClicked=!1},change:e.handleclick,input:e.handleInput},scopedSlots:e._u([{key:"append",fn:function(){return[a("v-text-field",{staticClass:"mt-0 pt-0",staticStyle:{width:"50px"},attrs:{dark:"",max:e.max,min:e.min,value:e.localValue,"hide-details":"","single-line":"",type:"number",step:e.step},on:{input:e.handleChange,focus:function(t){e.isFocused=!0},blur:function(t){e.isFocused=!1}}})]},proxy:!0}])})],1)],1)],1)},l=[],i={name:"Slider",props:["min","max","name","value","step"],data(){return{isFocused:!1,isClicked:!1}},methods:{handleChange(e){this.isFocused&&(this.localValue=parseFloat(e))},handleInput(e){!this.isFocused&&this.isClicked&&(this.localValue=e)},handleclick(e){this.isFocused||(this.localValue=e)}},computed:{localValue:{get(){return this.value},set(e){this.$emit("input",e)}}}},s=i,u=a("2877"),r=a("6544"),o=a.n(r),c=a("62ad"),d=a("0fd9"),p=a("ba0d"),m=a("8654"),v=Object(u["a"])(s,n,l,!1,null,"3505e445",null);t["a"]=v.exports;o()(v,{VCol:c["a"],VRow:d["a"],VSlider:p["a"],VTextField:m["a"]})},"5c73":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("CVrangeSlider",{attrs:{name:"Area",min:0,max:100,step:.1},on:{input:function(t){return e.handleData("area")}},model:{value:e.value.area,callback:function(t){e.$set(e.value,"area",t)},expression:"value.area"}}),a("CVrangeSlider",{attrs:{name:"Ratio (W/H)",min:0,max:100,step:.1},on:{input:function(t){return e.handleData("ratio")}},model:{value:e.value.ratio,callback:function(t){e.$set(e.value,"ratio",t)},expression:"value.ratio"}}),a("CVrangeSlider",{attrs:{name:"Extent",min:0,max:100},on:{input:function(t){return e.handleData("extent")}},model:{value:e.value.extent,callback:function(t){e.$set(e.value,"extent",t)},expression:"value.extent"}}),a("CVslider",{attrs:{name:"Speckle Rejection",min:0,max:100},on:{input:function(t){return e.handleData("speckle")}},model:{value:e.value.speckle,callback:function(t){e.$set(e.value,"speckle",t)},expression:"value.speckle"}}),a("CVselect",{attrs:{name:"Target Group",list:["Single","Dual"]},on:{input:function(t){return e.handleData("targetGroup")}},model:{value:e.value.targetGroup,callback:function(t){e.$set(e.value,"targetGroup",t)},expression:"value.targetGroup"}}),a("CVselect",{attrs:{name:"Target Intersection",list:["None","Up","Down","Left","Right"],disabled:e.isDisabled},on:{input:function(t){return e.handleData("targetIntersection")}},model:{value:e.value.targetIntersection,callback:function(t){e.$set(e.value,"targetIntersection",t)},expression:"value.targetIntersection"}})],1)},l=[],i=a("1029"),s=a("8384"),u=a("1447"),r={name:"Contours",props:["value"],components:{CVrangeSlider:i["a"],CVselect:s["a"],CVslider:u["a"]},methods:{handleData(e){this.handleInput(e,this.value[e]),this.$emit("update")}},data(){return{}},computed:{isDisabled(){return 0===this.value.targetGroup}}},o=r,c=a("2877"),d=Object(c["a"])(o,n,l,!1,null,"559b3ddb",null);t["default"]=d.exports}}]);
|
||||
//# sourceMappingURL=chunk-3ae1c3ad.60faee15.js.map
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3ae1c3ad"],{1447:function(e,t,a){"use strict";var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("v-row",{attrs:{dense:"",align:"center"}},[a("v-col",{attrs:{cols:2}},[a("span",[e._v(e._s(e.name))])]),a("v-col",{attrs:{cols:10}},[a("v-slider",{staticClass:"align-center",attrs:{value:e.localValue,dark:"",max:e.max,min:e.min,"hide-details":"",color:"#4baf62",step:e.step},on:{start:function(t){e.isClicked=!0},end:function(t){e.isClicked=!1},change:e.handleclick,input:e.handleInput},scopedSlots:e._u([{key:"append",fn:function(){return[a("v-text-field",{staticClass:"mt-0 pt-0",staticStyle:{width:"50px"},attrs:{dark:"",max:e.max,min:e.min,value:e.localValue,"hide-details":"","single-line":"",type:"number",step:e.step},on:{input:e.handleChange,focus:function(t){e.isFocused=!0},blur:function(t){e.isFocused=!1}}})]},proxy:!0}])})],1)],1)],1)},l=[],i={name:"Slider",props:["min","max","name","value","step"],data(){return{isFocused:!1,isClicked:!1}},methods:{handleChange(e){this.isFocused&&(this.localValue=parseFloat(e))},handleInput(e){!this.isFocused&&this.isClicked&&(this.localValue=e)},handleclick(e){this.isFocused||(this.localValue=e)}},computed:{localValue:{get(){return this.value},set(e){this.$emit("input",e)}}}},s=i,u=a("2877"),r=a("6544"),o=a.n(r),c=a("62ad"),d=a("0fd9"),p=a("ba0d"),m=a("8654"),v=Object(u["a"])(s,n,l,!1,null,"027e70b6",null);t["a"]=v.exports;o()(v,{VCol:c["a"],VRow:d["a"],VSlider:p["a"],VTextField:m["a"]})},"5c73":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("CVrangeSlider",{attrs:{name:"Area",min:0,max:100,step:.1},on:{input:function(t){return e.handleData("area")}},model:{value:e.value.area,callback:function(t){e.$set(e.value,"area",t)},expression:"value.area"}}),a("CVrangeSlider",{attrs:{name:"Ratio (W/H)",min:0,max:100,step:.1},on:{input:function(t){return e.handleData("ratio")}},model:{value:e.value.ratio,callback:function(t){e.$set(e.value,"ratio",t)},expression:"value.ratio"}}),a("CVrangeSlider",{attrs:{name:"Extent",min:0,max:100},on:{input:function(t){return e.handleData("extent")}},model:{value:e.value.extent,callback:function(t){e.$set(e.value,"extent",t)},expression:"value.extent"}}),a("CVslider",{attrs:{name:"Speckle Rejection",min:0,max:100},on:{input:function(t){return e.handleData("speckle")}},model:{value:e.value.speckle,callback:function(t){e.$set(e.value,"speckle",t)},expression:"value.speckle"}}),a("CVselect",{attrs:{name:"Target Group",list:["Single","Dual"]},on:{input:function(t){return e.handleData("targetGroup")}},model:{value:e.value.targetGroup,callback:function(t){e.$set(e.value,"targetGroup",t)},expression:"value.targetGroup"}}),a("CVselect",{attrs:{name:"Target Intersection",list:["None","Up","Down","Left","Right"],disabled:e.isDisabled},on:{input:function(t){return e.handleData("targetIntersection")}},model:{value:e.value.targetIntersection,callback:function(t){e.$set(e.value,"targetIntersection",t)},expression:"value.targetIntersection"}})],1)},l=[],i=a("1029"),s=a("8384"),u=a("1447"),r={name:"Contours",props:["value"],components:{CVrangeSlider:i["a"],CVselect:s["a"],CVslider:u["a"]},methods:{handleData(e){this.handleInput(e,this.value[e]),this.$emit("update")}},data(){return{}},computed:{isDisabled(){return 0===this.value.targetGroup}}},o=r,c=a("2877"),d=Object(c["a"])(o,n,l,!1,null,"003f692e",null);t["default"]=d.exports}}]);
|
||||
//# sourceMappingURL=chunk-3ae1c3ad.5aface64.js.map
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +0,0 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3af6ee7f"],{1447:function(e,t,r){"use strict";var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("v-row",{attrs:{dense:"",align:"center"}},[r("v-col",{attrs:{cols:2}},[r("span",[e._v(e._s(e.name))])]),r("v-col",{attrs:{cols:10}},[r("v-slider",{staticClass:"align-center",attrs:{value:e.localValue,dark:"",max:e.max,min:e.min,"hide-details":"",color:"#4baf62",step:e.step},on:{start:function(t){e.isClicked=!0},end:function(t){e.isClicked=!1},change:e.handleclick,input:e.handleInput},scopedSlots:e._u([{key:"append",fn:function(){return[r("v-text-field",{staticClass:"mt-0 pt-0",staticStyle:{width:"50px"},attrs:{dark:"",max:e.max,min:e.min,value:e.localValue,"hide-details":"","single-line":"",type:"number",step:e.step},on:{input:e.handleChange,focus:function(t){e.isFocused=!0},blur:function(t){e.isFocused=!1}}})]},proxy:!0}])})],1)],1)],1)},s=[],i={name:"Slider",props:["min","max","name","value","step"],data(){return{isFocused:!1,isClicked:!1}},methods:{handleChange(e){this.isFocused&&(this.localValue=parseFloat(e))},handleInput(e){!this.isFocused&&this.isClicked&&(this.localValue=e)},handleclick(e){this.isFocused||(this.localValue=e)}},computed:{localValue:{get(){return this.value},set(e){this.$emit("input",e)}}}},n=i,d=r("2877"),l=r("6544"),o=r.n(l),c=r("62ad"),u=r("0fd9"),m=r("ba0d"),v=r("8654"),p=Object(d["a"])(n,a,s,!1,null,"3505e445",null);t["a"]=p.exports;o()(p,{VCol:c["a"],VRow:u["a"],VSlider:m["a"],VTextField:v["a"]})},e5f2:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("CVselect",{attrs:{name:"Camera",list:e.cameraList},model:{value:e.currentCameraIndex,callback:function(t){e.currentCameraIndex=t},expression:"currentCameraIndex"}}),r("CVswitch",{attrs:{name:"Driver Mode"},on:{input:e.sendDriverMode},model:{value:e.driverState.isDriver,callback:function(t){e.$set(e.driverState,"isDriver",t)},expression:"driverState.isDriver"}}),r("CVslider",{attrs:{name:"Exposure",min:0,max:100},on:{input:e.sendDriverMode},model:{value:e.driverState.driverExposure,callback:function(t){e.$set(e.driverState,"driverExposure",t)},expression:"driverState.driverExposure"}}),r("CVslider",{attrs:{name:"Brightness",min:0,max:100},on:{input:e.sendDriverMode},model:{value:e.driverState.driverBrightness,callback:function(t){e.$set(e.driverState,"driverBrightness",t)},expression:"driverState.driverBrightness"}})],1)},s=[],i=r("8384"),n=r("b530"),d=r("1447"),l={name:"DriverMode",components:{CVselect:i["a"],CVswitch:n["a"],CVslider:d["a"]},methods:{sendDriverMode(){this.handleInput("driverMode",this.driverState),this.$emit("update")}},computed:{currentCameraIndex:{get(){return this.$store.state.currentCameraIndex},set(e){this.$store.commit("currentCameraIndex",e)}},cameraList:{get(){return this.$store.state.cameraList},set(e){this.$store.commit("cameraList",e)}},driverState:{get(){return this.$store.state.driverMode},set(e){this.$store.commit("driverMode",e)}}}},o=l,c=r("2877"),u=Object(c["a"])(o,a,s,!1,null,"a82c7778",null);t["default"]=u.exports}}]);
|
||||
//# sourceMappingURL=chunk-3af6ee7f.dfe1a485.js.map
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +0,0 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-98e0c8cc"],{"0b81":function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("CVselect",{attrs:{name:"Camera",list:t.cameraList},model:{value:t.currentCameraIndex,callback:function(e){t.currentCameraIndex=e},expression:"currentCameraIndex"}}),a("CVselect",{attrs:{name:"Resolution",list:t.resolutionList},model:{value:t.cameraSettings.resolution,callback:function(e){t.$set(t.cameraSettings,"resolution",e)},expression:"cameraSettings.resolution"}}),a("CVselect",{attrs:{name:"Stream Resolution",list:t.streamResolutionList},model:{value:t.cameraSettings.streamDivisor,callback:function(e){t.$set(t.cameraSettings,"streamDivisor",e)},expression:"cameraSettings.streamDivisor"}}),a("CVnumberinput",{attrs:{name:"Diagonal FOV"},model:{value:t.cameraSettings.fov,callback:function(e){t.$set(t.cameraSettings,"fov",e)},expression:"cameraSettings.fov"}}),a("v-btn",{staticStyle:{"margin-top":"10px"},attrs:{small:"",color:"#4baf62"},on:{click:t.sendCameraSettings}},[t._v("Save Camera Settings")])],1)},r=[],n=a("8384"),i=a("9696"),o={name:"CameraSettings",components:{CVselect:n["a"],CVnumberinput:i["a"]},data(){return{}},methods:{sendCameraSettings(){const t=this;this.axios.post("http://"+this.$address+"/api/settings/camera",this.cameraSettings).then((function(e){200===e.status&&(t.$store.state.saveBar=!0)}))}},computed:{currentCameraIndex:{get(){return this.$store.state.currentCameraIndex},set(t){this.$store.commit("currentCameraIndex",t)}},cameraList:{get(){return this.$store.state.cameraList},set(t){this.$store.commit("cameraList",t)}},resolutionList:{get(){let t=[];for(let e of this.$store.state.resolutionList)t.push(`${e["width"]} X ${e["height"]} at ${e["fps"]} FPS, ${e["pixelFormat"]}`);return t}},streamResolutionList:{get(){let t=this.$store.state.resolutionList[this.cameraSettings.resolution],e=[],a=1;for(let s=0;s<4;s++)e.push(`${t["width"]/a} X ${t["height"]/a}`),a*=2;return e}},cameraSettings:{get(){return this.$store.state.cameraSettings},set(t){this.$store.commit("cameraSettings",t)}}}},l=o,c=a("2877"),u=a("6544"),m=a.n(u),d=a("8336"),p=Object(c["a"])(l,s,r,!1,null,"1c3dd6f4",null);e["default"]=p.exports;m()(p,{VBtn:d["a"]})},9696:function(t,e,a){"use strict";var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("v-row",{attrs:{dense:"",align:"center"}},[a("v-col",{attrs:{cols:2}},[a("span",[t._v(t._s(t.name))])]),a("v-col",[a("v-text-field",{staticClass:"mt-0 pt-0",staticStyle:{width:"70px"},attrs:{dark:"","hide-details":"","single-line":"",type:"number"},model:{value:t.localValue,callback:function(e){t.localValue=e},expression:"localValue"}})],1)],1)],1)},r=[],n={name:"NumberInput",props:["name","value"],data(){return{}},computed:{localValue:{get(){return this.value},set(t){this.$emit("input",parseFloat(t))}}}},i=n,o=a("2877"),l=a("6544"),c=a.n(l),u=a("62ad"),m=a("0fd9"),d=a("8654"),p=Object(o["a"])(i,s,r,!1,null,"efc987b0",null);e["a"]=p.exports;c()(p,{VCol:u["a"],VRow:m["a"],VTextField:d["a"]})}}]);
|
||||
//# sourceMappingURL=chunk-98e0c8cc.a1d7ab48.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,2 +0,0 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-98e0c8cc"],{"0b81":function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("CVselect",{attrs:{name:"Camera",list:e.cameraList},model:{value:e.currentCameraIndex,callback:function(t){e.currentCameraIndex=t},expression:"currentCameraIndex"}}),a("CVselect",{attrs:{name:"Resolution",list:e.resolutionList},model:{value:e.cameraSettings.resolution,callback:function(t){e.$set(e.cameraSettings,"resolution",t)},expression:"cameraSettings.resolution"}}),a("CVselect",{attrs:{name:"Stream Resolution",list:["1:1","1:2","1:4","1:6"]},model:{value:e.cameraSettings.streamDivisor,callback:function(t){e.$set(e.cameraSettings,"streamDivisor",t)},expression:"cameraSettings.streamDivisor"}}),a("CVnumberinput",{attrs:{name:"Diagonal FOV"},model:{value:e.cameraSettings.fov,callback:function(t){e.$set(e.cameraSettings,"fov",t)},expression:"cameraSettings.fov"}}),a("v-btn",{staticStyle:{"margin-top":"10px"},attrs:{small:"",color:"#4baf62"},on:{click:e.sendCameraSettings}},[e._v("Save Camera Settings")])],1)},n=[],r=a("8384"),i=a("9696"),c={name:"CameraSettings",components:{CVselect:r["a"],CVnumberinput:i["a"]},data(){return{}},methods:{sendCameraSettings(){this.handleInput("cameraSettings",this.cameraSettings)}},computed:{currentCameraIndex:{get(){return this.$store.state.currentCameraIndex},set(e){this.$store.commit("currentCameraIndex",e)}},cameraList:{get(){return this.$store.state.cameraList},set(e){this.$store.commit("cameraList",e)}},resolutionList:{get(){return this.$store.state.resolutionList}},cameraSettings:{get(){return this.$store.state.cameraSettings},set(e){this.$store.commit("cameraSettings",e)}}}},l=c,o=a("2877"),m=a("6544"),u=a.n(m),d=a("8336"),p=Object(o["a"])(l,s,n,!1,null,"9200c51c",null);t["default"]=p.exports;u()(p,{VBtn:d["a"]})},9696:function(e,t,a){"use strict";var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("v-row",{attrs:{dense:"",align:"center"}},[a("v-col",{attrs:{cols:2}},[a("span",[e._v(e._s(e.name))])]),a("v-col",[a("v-text-field",{staticClass:"mt-0 pt-0",staticStyle:{width:"70px"},attrs:{dark:"","hide-details":"","single-line":"",type:"number"},model:{value:e.localValue,callback:function(t){e.localValue=t},expression:"localValue"}})],1)],1)],1)},n=[],r={name:"NumberInput",props:["name","value"],data(){return{}},computed:{localValue:{get(){return this.value},set(e){this.$emit("input",parseInt(e))}}}},i=r,c=a("2877"),l=a("6544"),o=a.n(l),m=a("62ad"),u=a("0fd9"),d=a("8654"),p=Object(c["a"])(i,s,n,!1,null,"648eb9bb",null);t["a"]=p.exports;o()(p,{VCol:m["a"],VRow:u["a"],VTextField:d["a"]})}}]);
|
||||
//# sourceMappingURL=chunk-98e0c8cc.cea7479c.js.map
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user