PhotonVision / photonvision

PhotonVision is the free, fast, and easy-to-use computer vision solution for the FIRST Robotics Competition.
https://photonvision.org
GNU General Public License v3.0
262 stars 166 forks source link

Move to using Absolute Exposure Range #1352

Open gerth2 opened 1 week ago

gerth2 commented 1 week ago

Uses logic in https://github.com/PhotonVision/photon-libcamera-gl-driver/pull/16 to push the ov9281 down to its true minimum exposure.

Updates UI to list the exposure settings in microseconds. Native units - not everyone works in microseconds.

Does its darndest to actually try to set the exposure in microseconds. Native Units. To do this...

Lifecam is funky when doing this - cscore limits the exposure settings to certain quantized values. Add a new camera quirk to allow that.

Updated camera quirks to re-evaluate every camera load (rather than recalling from settings - this shouldn't be necessary) This should be rolled back, needed for arducam type selection.

Updated camera quirk matching logic to make PID/VID optional, and basename optional (and only match trailing characters). This enables mirroring CSCore's logic for identifying lifecams by name.

Updated the USBCamera to primarily use cscore's exposed property names.

Since camera manufacturers use a potpourri of names for the same thing....

For nice-to-have settings: new soft-set logic to try all possible names, but gracefully pass if the property isn't there. For required settings: Search a list for the first setting that's supported, fail if none are supported.

More logging of camera properties to help debug.

Note: most of this work is because cscore doesn't directly expose a massaged exposure-setting-absolute API (and, given what we've seen, probably shouldn't, this struggle is not for the faint of heart).