Vishal
Vishal

Reputation: 3296

Changing camera exposure on frame by frame basis

Is it possible to change exposure of a webcam on a frame-to-frame basis, with proper synchronization. My operating system is Ubuntu 14.04. Webcam - Logitech HD Pro 920
I know for sure that it's not possible with OpenCV.
And certainly it would also depend upon the webcam being used.

What I need is a callback mechanism which notifies me when the setting of exposure change has taken effect. And also, to be able to synchronize the exposure change setting command at the correct frame boundaries (just in case this is required to be done by the user).

I assume something like using V4L2 would be my best bet?
Kindly guide me.

Upvotes: 0

Views: 1502

Answers (1)

thomas_haximus
thomas_haximus

Reputation: 1531

You can use v4l2-ctl terminal commands or OpenCV to do this.

In OpenCV you can use this function:

VideoCapture.set(CV_CAP_PROP_EXPOSURE,value);

In a linux terminal you can use:

v4l2-ctl --set-ctrl=exposure_absolute=value --device=/dev/video1

For both ways you can use the get command in a similar way to see the current setting

Upvotes: 1

Related Questions