diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/hardware/Camera.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/hardware/Camera.java index fe6f35f..9261fa1 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/hardware/Camera.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/hardware/Camera.java @@ -20,12 +20,10 @@ public class Camera { private TargetingPipeline targetingPipeline; private boolean targetingCameraInitialized; - // Constructor public Camera(HardwareMap hardwareMap) { this.hardwareMap = hardwareMap; } - // Initiate the Targeting Camera public void initTargetingCamera() { int targetingCameraMonitorViewId = hardwareMap.appContext.getResources().getIdentifier("cameraMonitorViewId", "id", hardwareMap.appContext.getPackageName()); this.targetingCamera = OpenCvCameraFactory.getInstance().createWebcam(hardwareMap.get(WebcamName.class, TARGETING_WEBCAM), targetingCameraMonitorViewId); @@ -45,14 +43,12 @@ public class Camera { }); } - // Close the Targeting Camera public void stopTargetingCamera() { if (targetingCameraInitialized) { targetingCamera.closeCameraDeviceAsync(() -> targetingCameraInitialized = false); } } - // Get the Red Goal Detection public Detection getRed() { return (targetingCameraInitialized ? targetingPipeline.getRed() : INVALID_DETECTION); } diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/vision/Detection.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/vision/Detection.java index 9db2a18..7db4bd9 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/vision/Detection.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/vision/Detection.java @@ -54,8 +54,6 @@ public class Detection { if (isValid()) { drawConvexHull(img, contour, color); drawPoint(img, centerPx, GREEN); -// drawPoint(img, bottomLeftPx, GREEN); -// drawPoint(img, bottomRightPx, GREEN); } } @@ -64,14 +62,11 @@ public class Detection { if (isValid()) { fillConvexHull(img, contour, color); drawPoint(img, centerPx, GREEN); -// drawPoint(img, bottomLeftPx, GREEN); -// drawPoint(img, bottomRightPx, GREEN); } } // Check if the current Detection is valid public boolean isValid() { -// return true; return (this.contour != null) && (this.centerPx != INVALID_POINT) && (this.areaPx != INVALID_AREA); }