From e7eecbcf84a283cb1843278a6afc2d269282e950 Mon Sep 17 00:00:00 2001 From: Matthew Morley Date: Wed, 18 Oct 2023 21:42:36 -0400 Subject: [PATCH] Actually set detector params --- .../photonvision/vision/aruco/PhotonArucoDetector.java | 8 ++++++++ .../photonvision/vision/pipe/impl/ArucoDetectionPipe.java | 2 ++ 2 files changed, 10 insertions(+) diff --git a/photon-core/src/main/java/org/photonvision/vision/aruco/PhotonArucoDetector.java b/photon-core/src/main/java/org/photonvision/vision/aruco/PhotonArucoDetector.java index f0f8eaba8b..acab02a176 100644 --- a/photon-core/src/main/java/org/photonvision/vision/aruco/PhotonArucoDetector.java +++ b/photon-core/src/main/java/org/photonvision/vision/aruco/PhotonArucoDetector.java @@ -48,10 +48,18 @@ public ArucoDetector getDetector() { return detector; } + /** + * Get a copy of the current parameters being used. Must next call setParams to update the + * underlying detector object! + */ public DetectorParameters getParams() { return params; } + public void setParams(DetectorParameters params) { + detector.setDetectorParameters(params); + } + /** * Detect fiducial tags in the grayscaled image using the {@link ArucoDetector} in this class. * Parameters for detection can be modified with {@link #setDetectorParams(DetectorParameters)}. diff --git a/photon-core/src/main/java/org/photonvision/vision/pipe/impl/ArucoDetectionPipe.java b/photon-core/src/main/java/org/photonvision/vision/pipe/impl/ArucoDetectionPipe.java index 3d97e506ce..1ea4fcd2ca 100644 --- a/photon-core/src/main/java/org/photonvision/vision/pipe/impl/ArucoDetectionPipe.java +++ b/photon-core/src/main/java/org/photonvision/vision/pipe/impl/ArucoDetectionPipe.java @@ -107,6 +107,8 @@ public void setParams(ArucoDetectionPipeParams newParams) { detectParams.set_useAruco3Detection(newParams.useAruco3); detectParams.set_minSideLengthCanonicalImg(newParams.aruco3MinCanonicalImgSide); detectParams.set_minMarkerLengthRatioOriginalImg((float) newParams.aruco3MinMarkerSideRatio); + + photonDetector.setParams(detectParams); } super.setParams(newParams);