Skip to content

Fixes Auto Exposure when v4l is the CV Backend - #49

Merged
lixfel merged 4 commits into
masterfrom
dev/will/opencv_auto_exposure_fix
Nov 8, 2026
Merged

lixfel merged 4 commits into
masterfrom
dev/will/opencv_auto_exposure_fix

Conversation

@guyfleeman

Copy link
Copy Markdown
Contributor

When v4l is selected as the backend for OpenCV, it passes exposure mode straight through to v4l. This means the OpenCV exposure mode constants of 0.25/0.75 are not valid, and the values 1 and 3 should be used (int 0-4 instead of 0-1f). This PR checks the backend, and selects the correct constants. It also performs some ordering when leaving auto exposure to ensure the manual exposure value takes.

Also, grabbing an invalid file handle would core dump. This adds a 2 line guard with a FATAL log when the fh is invalid.

Tested locally on UC70 UVC camera.

@guyfleeman
guyfleeman requested a review from lixfel November 7, 2026 19:17
@guyfleeman guyfleeman self-assigned this Nov 7, 2026

@lixfel lixfel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Merge conflict remaining

@lixfel
lixfel merged commit e9183a5 into master Nov 8, 2026
3 checks passed
@lixfel
lixfel deleted the dev/will/opencv_auto_exposure_fix branch November 8, 2026 08:40
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.

2 participants