-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renames, improved camera-specific settables
- Loading branch information
Showing
7 changed files
with
84 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...re/src/main/java/org/photonvision/vision/camera/USBCameras/ArduOV2311CameraSettables.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.photonvision.vision.camera.USBCameras; | ||
|
||
import edu.wpi.first.cscore.UsbCamera; | ||
|
||
|
||
import org.photonvision.common.configuration.CameraConfiguration; | ||
|
||
public class ArduOV2311CameraSettables extends GenericUSBCameraSettables { | ||
|
||
public ArduOV2311CameraSettables(CameraConfiguration configuration, UsbCamera camera) { | ||
super(configuration, camera); | ||
} | ||
|
||
@Override | ||
protected void setUpExposureProperties() { | ||
super.setUpExposureProperties(); | ||
|
||
// Property limits are incorrect | ||
this.minExposure = 1; | ||
this.maxExposure = 75; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...on-core/src/main/java/org/photonvision/vision/camera/USBCameras/PsEyeCameraSettables.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.photonvision.vision.camera.USBCameras; | ||
|
||
import edu.wpi.first.cscore.UsbCamera; | ||
|
||
|
||
import org.photonvision.common.configuration.CameraConfiguration; | ||
|
||
public class PsEyeCameraSettables extends GenericUSBCameraSettables { | ||
|
||
public PsEyeCameraSettables(CameraConfiguration configuration, UsbCamera camera) { | ||
super(configuration, camera); | ||
} | ||
|
||
public void setAutoExposure(boolean cameraAutoExposure) { | ||
logger.debug("Setting auto exposure to " + cameraAutoExposure); | ||
|
||
// PS Eye uses inverted 1=Disabled, 0=Enabled for auto exposure | ||
if (!cameraAutoExposure) { | ||
autoExposureProp.set(1); | ||
|
||
// Most cameras leave exposure time absolute at the last value | ||
// from their auto exposure algorithm. | ||
// Set it back to the exposure slider value | ||
setExposureRaw(this.lastExposureRaw); | ||
|
||
} else { | ||
autoExposureProp.set(0); | ||
} | ||
} | ||
|
||
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 | ||
softSet("raw_hue", 0); | ||
softSet("raw_contrast", 32); | ||
softSet("raw_saturation", 100); | ||
softSet("raw_hue", -10); | ||
softSet("raw_sharpness", 0); | ||
softSet("white_balance_automatic", 0); | ||
softSet("gain_automatic", 0); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters