From 0d1aa248f59dde130a9814a477454f208d1a238b Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 22 Sep 2024 14:09:57 -0500 Subject: [PATCH 1/3] Revised 9782 defaults --- .../java/org/photonvision/vision/camera/QuirkyCamera.java | 4 ++-- .../camera/USBCameras/ArduOV9782CameraSettables.java | 8 ++++++++ .../camera/USBCameras/GenericUSBCameraSettables.java | 1 - 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/photon-core/src/main/java/org/photonvision/vision/camera/QuirkyCamera.java b/photon-core/src/main/java/org/photonvision/vision/camera/QuirkyCamera.java index 2eb1982fd9..8f1f5a54ca 100644 --- a/photon-core/src/main/java/org/photonvision/vision/camera/QuirkyCamera.java +++ b/photon-core/src/main/java/org/photonvision/vision/camera/QuirkyCamera.java @@ -73,7 +73,7 @@ public class QuirkyCamera { "OV9281", CameraQuirk.ArduCamCamera, CameraQuirk.ArduOV9281Controls), - // Arducam OV + // Arducam OV9782 new QuirkyCamera( 0x0c45, 0x6366, @@ -83,7 +83,7 @@ public class QuirkyCamera { CameraQuirk.ArduOV9782Controls), // Innomaker OV9281 new QuirkyCamera( - 0x0c45, 0x636d, "USB Camera", "USB Camera", CameraQuirk.InnoOV9281Controls)); + 0x0c45, 0x636d, "USB Camera", "Innomaker OV9281", CameraQuirk.InnoOV9281Controls)); public static final QuirkyCamera DefaultCamera = new QuirkyCamera(0, 0, ""); public static final QuirkyCamera ZeroCopyPiCamera = diff --git a/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/ArduOV9782CameraSettables.java b/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/ArduOV9782CameraSettables.java index caf8036894..94cb7c351f 100644 --- a/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/ArduOV9782CameraSettables.java +++ b/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/ArduOV9782CameraSettables.java @@ -26,6 +26,14 @@ public ArduOV9782CameraSettables(CameraConfiguration configuration, UsbCamera ca whiteBalanceTemperature = 3500; } + public void setAllCamDefaults() { + softSet("power_line_frequency", 2); // Assume 60Hz USA + softSet("exposure_metering_mode", 0); + softSet("exposure_dynamic_framerate", 0); + softSet("white_balance_automatic", 0); + softSet("white_balance_temperature", whiteBalanceTemperature); + } + @Override protected void setUpExposureProperties() { super.setUpExposureProperties(); diff --git a/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/GenericUSBCameraSettables.java b/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/GenericUSBCameraSettables.java index e83fe11b50..818b567df3 100644 --- a/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/GenericUSBCameraSettables.java +++ b/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/GenericUSBCameraSettables.java @@ -100,7 +100,6 @@ public void setAllCamDefaults() { softSet("exposure_dynamic_framerate", 0); softSet("focus_auto", 0); softSet("focus_absolute", 0); // Focus into infinity - softSet("white_balance_temperature", whiteBalanceTemperature); } public void setAutoExposure(boolean cameraAutoExposure) { From 21fe025ea85344071bd433c5d1cbee3f6f43700a Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 22 Sep 2024 15:13:26 -0500 Subject: [PATCH 2/3] Added gain support --- .../main/java/org/photonvision/vision/camera/QuirkyCamera.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/photon-core/src/main/java/org/photonvision/vision/camera/QuirkyCamera.java b/photon-core/src/main/java/org/photonvision/vision/camera/QuirkyCamera.java index 8f1f5a54ca..5debd40108 100644 --- a/photon-core/src/main/java/org/photonvision/vision/camera/QuirkyCamera.java +++ b/photon-core/src/main/java/org/photonvision/vision/camera/QuirkyCamera.java @@ -55,6 +55,7 @@ public class QuirkyCamera { "", "Arducam Generic", CameraQuirk.ArduCamCamera, + CameraQuirk.Gain, CameraQuirk.StickyFPS), // Arducam OV2311 new QuirkyCamera( @@ -80,6 +81,7 @@ public class QuirkyCamera { "OV9782", "OV9782", CameraQuirk.ArduCamCamera, + CameraQuirk.Gain, CameraQuirk.ArduOV9782Controls), // Innomaker OV9281 new QuirkyCamera( From 59b5517ecc4ea2b17741f8f2f074387cabfe5bf0 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 22 Sep 2024 16:55:18 -0500 Subject: [PATCH 3/3] override fixups --- .../vision/camera/USBCameras/ArduOV9782CameraSettables.java | 1 + .../camera/USBCameras/LifeCam3kWindowsCameraSettables.java | 1 + .../vision/camera/USBCameras/PsEyeCameraSettables.java | 2 ++ 3 files changed, 4 insertions(+) diff --git a/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/ArduOV9782CameraSettables.java b/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/ArduOV9782CameraSettables.java index 94cb7c351f..70fdbf9e1d 100644 --- a/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/ArduOV9782CameraSettables.java +++ b/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/ArduOV9782CameraSettables.java @@ -26,6 +26,7 @@ public ArduOV9782CameraSettables(CameraConfiguration configuration, UsbCamera ca whiteBalanceTemperature = 3500; } + @Override public void setAllCamDefaults() { softSet("power_line_frequency", 2); // Assume 60Hz USA softSet("exposure_metering_mode", 0); diff --git a/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/LifeCam3kWindowsCameraSettables.java b/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/LifeCam3kWindowsCameraSettables.java index ef4a3029cd..b52dbd84de 100644 --- a/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/LifeCam3kWindowsCameraSettables.java +++ b/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/LifeCam3kWindowsCameraSettables.java @@ -61,6 +61,7 @@ public void setExposureRaw(double exposureRaw) { } } + @Override public void setAutoExposure(boolean cameraAutoExposure) { logger.debug("Setting auto exposure to " + cameraAutoExposure); diff --git a/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/PsEyeCameraSettables.java b/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/PsEyeCameraSettables.java index 8195ca4931..50e06916d0 100644 --- a/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/PsEyeCameraSettables.java +++ b/photon-core/src/main/java/org/photonvision/vision/camera/USBCameras/PsEyeCameraSettables.java @@ -25,6 +25,7 @@ public PsEyeCameraSettables(CameraConfiguration configuration, UsbCamera camera) super(configuration, camera); } + @Override public void setAutoExposure(boolean cameraAutoExposure) { logger.debug("Setting auto exposure to " + cameraAutoExposure); @@ -42,6 +43,7 @@ public void setAutoExposure(boolean cameraAutoExposure) { } } + @Override public void setAllCamDefaults() { // Common settings for all cameras to attempt to get their image // as close as possible to what we want for image processing