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

Added auto exposure support #63

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

chrisrca
Copy link

When using some webcams the exposure setting does not correctly adjust the camera's exposure, leaving the surroundings much darker than they should be. This can be seen here as the exposure is set to -7 by default the camera shows a completely black screen.

image

Even after adjusting this value the room is still barely visible and not acceptable for mocap.

image
image

By allowing string inputs on the exposure field we can set the camera's exposure to automatic when "auto" is entered, switching to automatic exposure and instantly brightening the room up to an acceptable level. This field still accepts integer entries for those who want to use it.

image

Video of change:

ezgif-7-ca53b40e67

@jonmatthis
Copy link
Member

Hello! Thank you for this!

We've desperately needed auto exposure for a while, but I could never quite figure it out!

I saw that you used 0.75/0.25 to switch from auto to manual exposure (that was the trick I didn't know!), do you know if that is camera/platform/backend specific? Are you running your on Windows, Mac, or Linux?

This thread on the opencv repo discusses these settings, and I see some folks using 1 and 3 to set their exposure :

ihttps://github.com/opencv/opencv/issues/9738

Are you aware of actual documentation about CAP_PROP_AUTO_EXPOSURE setting?

In any case, thanks again for this! I will poke around with this a bit and see what I can figure out from my end.

@chrisrca
Copy link
Author

Hi! Sorry for the delayed response.

I've only tested this on Windows although it might work on Linux and Mac as is. (I don't really know anything about about its usage on those platforms, I've just seen that some camera drivers may be needed for it which sounds like a lot of extra and possibly hardware specific stuff). Just needed it for one of my cameras and it seemed like a simple addition. I believe it should just work for any non-virtual windows camera but that would also need to be tested (it has worked for various different usb cameras that I have tried though).

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