Repository navigation
Conversation
Meter the synchronized frames and set the same exposure time and strobe width on every camera in the group. ISO stays at the user's value. The capture loop hands each frame set to the controller, which keeps only the newest so capture never waits. The controller runs on its own thread at up to 10 Hz, decodes both JPEGs at 1/8 scale in grayscale and steps a single light level in EV. The strobe follows the light level and the exposure is the shortest that contains it. A 98th percentile highlight limit wins over the mean target when it asks for less light, so the loop settles at the limit instead of bouncing across it. Tuned on two cameras: writes use group hold and show 2 frames later, luma grows like light^0.5, and exposure stops adding light at VTS - 13, so the longest exposure comes from the sensor's VTS instead of the table. Settles in 4-6 updates without overshoot. Adds "Auto Exposure (Software)" and "AE Target Brightness" controls. Software and firmware auto exposure are mutually exclusive, and both lock the Exposure Time and Strobe Width sliders. Adds Pillow.
The sensor only answers I2C a second or two after the stream starts, so the exposure, ISO and strobe writes made right after starting it were lost. The firmware also turns its auto exposure on while starting the sensor, so the camera ran firmware AE while the setting said off. After a stream starts, wait until every sensor in the group answers, reapply the settings, and check that the firmware AE matches the setting, writing it again if not (3 checks, 0.5 s apart). Waiting is cancelled if the stream stops or restarts.
Member
Author
|
Slop pr but good for testing! |
|
Preview build: curl -s https://raw.githubusercontent.com/DeepWaterExploration/dweOS/main/install.sh | sudo bash -s preview-pr-639Rebuilt on every push. Closing this pull request deletes the preview. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a software auto exposure that sets strobe width and exposure time for synchronized stellarHD streams, with the same values on every camera in the group. ISO stays at the user's value. Also fixes sensor settings (and the firmware AE setting) being lost when a stream starts.
Stacked on #638, which this needs for the firmware I2C sensor writes.
Software auto exposure
ASICInterfaceworker under one queue key (newest value wins), in a single OmniVision group hold (0x3208).Fix: settings lost at stream start
The sensor only answers I2C a second or two after the stream starts, so the exposure, ISO and strobe writes made right after starting it were dropped. The firmware also turns its AE on while starting the sensor, so the camera ran firmware AE while the UI said off (it took two clicks to really turn it off). After a stream starts, a background thread now waits for every sensor to answer, reapplies the settings, and checks that the firmware AE matches the setting (3 checks, 0.5 s apart).
Tuning (measured on stellarHD + explore3D)
SETTLE_FRAMES = 3(1 oscillates)RESPONSE_EXPONENT = 0.5LOOP_GAIN = 0.8Note: the frontend's
FPS_TO_MAX_EXPOSUREhas the same 30 fps value (2942), so the manual Exposure Time slider allows values that do nothing on this firmware. Not changed here.Type of change
Quick Checklist