Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes windows not allowing auto exposure prop for the ov2311 #1407

Merged
merged 4 commits into from
Sep 4, 2024

Conversation

r4stered
Copy link
Contributor

@r4stered r4stered commented Sep 3, 2024

This allows the arducam ov2311 to be used on windows with manual exposure. The ov2311 doesn't show any auto exposure properties on windows:

[2024-09-03 15:14:12] [Camera - USBCameraSource - Arducam_OV2311_USB_Camera] [DEBUG] Cam Properties Dump:
Name: raw_Brightness, Kind: kInteger, Value: 2, Min: -64, Max: 64, Dflt: 0, Step: 1
Name: Brightness, Kind: kInteger, Value: 2, Min: 0, Max: 100, Dflt: 50, Step: 1
Name: raw_Contrast, Kind: kInteger, Value: 2, Min: 0, Max: 64, Dflt: 32, Step: 1
Name: Contrast, Kind: kInteger, Value: 2, Min: 0, Max: 100, Dflt: 50, Step: 1
Name: raw_Hue, Kind: kInteger, Value: 2, Min: -40, Max: 40, Dflt: 0, Step: 1
Name: Hue, Kind: kInteger, Value: 2, Min: 0, Max: 100, Dflt: 50, Step: 1
Name: raw_Saturation, Kind: kInteger, Value: 2, Min: 0, Max: 128, Dflt: 64, Step: 1
Name: Saturation, Kind: kInteger, Value: 2, Min: 0, Max: 100, Dflt: 50, Step: 1
Name: raw_Sharpness, Kind: kInteger, Value: 2, Min: 0, Max: 6, Dflt: 3, Step: 1
Name: Sharpness, Kind: kInteger, Value: 2, Min: 0, Max: 100, Dflt: 50, Step: 1
Name: Gamma, Kind: kInteger, Value: 2, Min: 72, Max: 500, Dflt: 100, Step: 1
Name: WhiteBalance, Kind: kInteger, Value: 2, Min: 2800, Max: 6500, Dflt: 4600, Step: 1
Name: BacklightCompensation, Kind: kInteger, Value: 2, Min: 0, Max: 2, Dflt: 1, Step: 1
Name: raw_Gain, Kind: kInteger, Value: 2, Min: 0, Max: 100, Dflt: 0, Step: 1
Name: Gain, Kind: kInteger, Value: 2, Min: 0, Max: 100, Dflt: 0, Step: 1
Name: raw_Exposure, Kind: kInteger, Value: 2, Min: -13, Max: -1, Dflt: -6, Step: 1
Name: Exposure, Kind: kInteger, Value: 2, Min: 0, Max: 100, Dflt: 58, Step: 1

This caused the arducam settables not to work because it tried to set the auto exposure prop.

[2024-09-03 15:14:12] [VisionModule - VisionSourceSettables] [WARN] Expected at least one of the following properties to be available: [exposure_auto, auto_exposure]

For reference, using the same exact camera, here are the props I get on linux x86:

[2024-09-03 15:15:51] [Camera - USBCameraSource - Arducam_OV2311_USB_Camera] [DEBUG] Cam Properties Dump:
Name: connect_verbose, Kind: kInteger, Value: 2, Min: 0, Max: 1, Dflt: 1, Step: 1
Name: , Kind: kNone, Value: 0, Min: 0, Max: 0, Dflt: 0, Step: 0
Name: raw_brightness, Kind: kInteger, Value: 2, Min: -64, Max: 64, Dflt: 0, Step: 1
Name: brightness, Kind: kInteger, Value: 2, Min: 0, Max: 100, Dflt: 50, Step: 1
Name: raw_contrast, Kind: kInteger, Value: 2, Min: 0, Max: 64, Dflt: 32, Step: 1
Name: contrast, Kind: kInteger, Value: 2, Min: 0, Max: 100, Dflt: 50, Step: 1
Name: raw_saturation, Kind: kInteger, Value: 2, Min: 0, Max: 128, Dflt: 64, Step: 1
Name: saturation, Kind: kInteger, Value: 2, Min: 0, Max: 100, Dflt: 50, Step: 1
Name: raw_hue, Kind: kInteger, Value: 2, Min: -40, Max: 40, Dflt: 0, Step: 1
Name: hue, Kind: kInteger, Value: 2, Min: 0, Max: 100, Dflt: 50, Step: 1
Name: white_balance_automatic, Kind: kBoolean, Value: 1, Min: 0, Max: 1, Dflt: 1, Step: 1
Name: gamma, Kind: kInteger, Value: 2, Min: 72, Max: 500, Dflt: 100, Step: 1
Name: raw_gain, Kind: kInteger, Value: 2, Min: 0, Max: 100, Dflt: 0, Step: 1
Name: gain, Kind: kInteger, Value: 2, Min: 0, Max: 100, Dflt: 0, Step: 1
Name: power_line_frequency, Kind: kEnum, Value: 8, Min: 0, Max: 2, Dflt: 2, Step: 1
Name: white_balance_temperature, Kind: kInteger, Value: 2, Min: 2800, Max: 6500, Dflt: 4600, Step: 1
Name: raw_sharpness, Kind: kInteger, Value: 2, Min: 0, Max: 6, Dflt: 3, Step: 1
Name: sharpness, Kind: kInteger, Value: 2, Min: 0, Max: 100, Dflt: 50, Step: 1
Name: backlight_compensation, Kind: kInteger, Value: 2, Min: 0, Max: 2, Dflt: 1, Step: 1
Name: auto_exposure, Kind: kEnum, Value: 8, Min: 0, Max: 3, Dflt: 3, Step: 1
Name: raw_exposure_time_absolute, Kind: kInteger, Value: 2, Min: 1, Max: 5000, Dflt: 157, Step: 1
Name: exposure_time_absolute, Kind: kInteger, Value: 2, Min: 0, Max: 100, Dflt: 3, Step: 1
Name: exposure_dynamic_framerate, Kind: kBoolean, Value: 1, Min: 0, Max: 1, Dflt: 0, Step: 1

@r4stered r4stered requested a review from a team as a code owner September 3, 2024 19:22
@mdurrani808
Copy link
Contributor

should platform specific settables be handled via a parameter passed into the class or just be a seperate class as it is right now? Ultimately doesn't matter either way, just curious

@mcm001
Copy link
Contributor

mcm001 commented Sep 3, 2024

Can you add a javadoc/comment to this new class and to ArduOV2311CameraSettables explaining why one is platform dependent?

Copy link
Contributor

@mcm001 mcm001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@mcm001 mcm001 merged commit 06f0f7d into PhotonVision:master Sep 4, 2024
31 checks passed
@r4stered r4stered deleted the ov2311-windows-quirks branch September 6, 2024 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants