You are not logged in.

#1 2015-09-20 18:36:50

lemonWater
Member
Registered: 2015-09-19
Posts: 4

[SOLVED] Stop Webcam from auto adjusting brightness

I'm using Python and OpenCV on my laptop to make a simple motion detection script using the built in webcam.

Basically my script takes an initial reference image, and then constantly compares subsequent frames to the initial image and looks for any differences using cv2.absdiff(), which is how it detects motion. I greyscale and blur both images being compared, and then use a binary thresh on the resulting difference.

It works fine when the object being detected is small or far away, but if, say, a person walks up to within a few feet of the webcam, the webcam automatically adjusts its brightness, ruining the result.

How would I go about disabling this auto brightness function of the webcam in arch?

Last edited by lemonWater (2015-09-21 01:44:43)

Offline

#2 2015-09-20 18:58:25

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Stop Webcam from auto adjusting brightness

Are you sure that it's even Arch doing this?

In most cases the auto-brightness is handled in the webcams hardware.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2015-09-20 19:24:18

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] Stop Webcam from auto adjusting brightness

Try 'v4l2-ctl -l' and check if there is something like white_balance_temperature_auto and try changing it with 'v4l2-ctl -c white_balance_temperature_auto=0', if it works you can write an udev rule to do that for you every time the webcam is detected.

Other settings may be responsible for your "problem", such as backlight_compensation, so try to change a few settings and see if it solves your problem.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#4 2015-09-21 01:44:24

lemonWater
Member
Registered: 2015-09-19
Posts: 4

Re: [SOLVED] Stop Webcam from auto adjusting brightness

Turns out it was a hardware issue, fixed

Offline

Board footer

Powered by FluxBB